Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Other Engineering Expert

Lab

Create a function, void Init_PWM(void) which configures the 3 pulse width modulation signals. Use Timer B.

Use the following count register definitions:

TB0CCR0 - Repeat frequency (PERIOD) TB0CCR2 - Blue element duty cycle TB0CCR3 - Green element duty cycle TB0CCR4 - Red element duty cycle

To do this you must perform the following configurations:

1. Set up the TB0CTL register to use the ACLK as the counter source, and the mode to up-mode. You may assume that the other register settings are fine in their default state. NOTE that it is acceptable and PREFERRABLE to define all of the bits the first time you initialize a register.

Do not bit set and bit clear. Program the register with a 16-bit hexadecimal value.

2. Set up the TB0CCTL2, TB0CCTL3, TB0CCTL4 registers to all do the following:

a. CLLD (Compare Latch Load) set to TB0CLn loads when TB0R counts to 0 (up or continuous mode) (n=2,3,4).

b. OUTMOD set to Reset/Set

You may assume that the other TB0CCTLx register settings are fine in their default state. NOTE that it is acceptable and PREFERRABLE to define all of the bits the first time you initialize a register. Do not bit set and bit clear. Program the register with a 16-bit hexadecimal value.

3. Use TB0CCR0 for the Pulse Period and set to 100 Hz (use the value for #define PERIOD in 3567.h).

4. Configure P2.2, P3.6, and P3.7 as the outputs.

a. Set the bits in the correct PxDIR registers

5. Set outputs to Secondary Function [10] for PWM

a. Set the correct bitr is PxSEL1

b. Clear the correct bit in PxSEL0

The preceding sets up the TB0.2, TBO.3, and TBO.4 for PWM. Refer to the Quick Start Guide for the Evaluation Board located in Useful Info on the class website.

6. Use the following variables for the 3 RGB pulse widths

a. duty_cycle_red TB0.4

b. duty_cycle_green TB0.3

c. duty_cycle_blue TB0.2

Checkpoint 1: Ask the Lab Monitors to check your values for the Timer Control Registers (TB0CTL, TB0CCTL2, TB0CCTL3, TB0CCTL4).

Checkpoint 2: Demonstrate the 3 PWM signals on the oscilloscope with duty cycles of 25% for Blue, 50% for green and 75% for red.

Create a file called RGB_LED.c. write code to adjust the 3 PWMs to generate the following colors and conditions when the corresponding commands are sent from Putty.

LH - Red, Flashing at > 4 Hz LR - Red
LO - Orange LY - Yellow LG - Green LB - Blue
LP - Purple
LC - Purple, Flashing at > 4 Hz

I recommend a duty cycle setting 0f 0x100 for both blue and red alone, and 0x070 for green alone. The combinations for purple, orange, and yellow should never use a duty cycle more than 0x100. It will be too bright.

You should also add enable and disable commands for an LED Test Mode. LT should enable this mode. LD should disable this mode.

For the Flash conditions on the LH (Hot) and LC (Cold) commands, use the Timer A0 interrupt service routine in main to enable and disable the PWM.

Instead of every 10 cycles, make the OFF/ON (the Flash) toggle every time the interrupt service routine executes. There are a number of ways to do OFF and ON without re-initializing!

Checkpoint 3: Demonstrate 8 LED conditions using the commands from Putty

Checkpoint 4: Clean-up Checkpoint. Please leave the Custom Booster Pack board in the lab.

Other Engineering, Engineering

  • Category:- Other Engineering
  • Reference No.:- M92724211

Have any Question?


Related Questions in Other Engineering

Question 1 define rock mechanics discuss the main

Question 1 . Define rock mechanics. Discuss the main objectives of the application of rock mechanics in mining. Question 2. Define stress. Draw a diagram and define the normal and shear stress by resolving the resultant ...

Assignment 11 what is the purpose of ore reserve and

ASSIGNMENT 1 1. What is the purpose of ore reserve and resource estimation? Why are resource and reserve estimates important to the mining industry? 2. What is meant by ore? What is meant by the term waste? How is the di ...

Projection of planes1 a regular pentagon of 25 mm side has

Projection of Planes 1. A regular pentagon of 25 mm side has one side on the ground. Its plane is inclined at 45° to H.P. and perpendicular to the V.P. Draw its projections. 2. Draw the projection of a circle of 50 mm di ...

Question - show that the zero-point energy of a simple

Question - Show that the zero-point energy of a simple harmonic oscillator does not contribute to its entropy or heat capacity, but does contribute to its energy and Helmholtz function.

Assignment 11 what is the purpose of ore reserve and

ASSIGNMENT 1 1. What is the purpose of ore reserve and resource estimation? Why are resource and reserve estimates important to the mining industry? 2. What is meant by ore? What is meant by the term waste? How is the di ...

Load fault level analysis amp protection design of a remote

LOAD, FAULT LEVEL ANALYSIS & PROTECTION DESIGN OF A REMOTE AREA MICROGRID Assignment Please undertake the following analyses: 1. Calculate the 3-phase fault levels on Bus 2, Bus 3 and Bus 4 with the main supply connected ...

Mine safety amp environmental engineering assignment -part

Mine Safety & Environmental Engineering Assignment - Part 1 - Questions 1. Occupational health and safety is the primary factor that needs to be considered in the mining industry. Discuss this statement. 2. Define the fo ...

Introduction to engineering design assignment -

Introduction to Engineering Design Assignment - Drafting Question 1 - Field notes and traverse drawing may be an outdated form of keeping and presenting information on the position of features on a site. Modern electroni ...

Q 1a discontinuity is found fully developed from the toe to

Q. 1 A discontinuity is found fully developed from the toe to the bench surface on a 15 m high slope, slope angle 65°. The discontinuity (frictional angle 32° and cohesion 20 kN/m2) is planar and its strike is parallel t ...

1 online discussion forum - post your proposed topic and

1. Online Discussion forum - Post your proposed topic and chosen data set as well as a short plan for the project. This is required for approval of the topic. As discussed, students must select unique topics, therefore i ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As