Create a function which configures the three pulse

Assignment Help Other Engineering
Reference no: EM131895864

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.

Reference no: EM131895864

Questions Cloud

Discuss managed cares role in promoting health : Discuss the impact managed care has on the access, financing, and delivery of health care in the United States.
Prepare the journal entries farmers products should make : Prepare the disclosures and/or journal entries Farmers Products should make in preparing its December 31, 2016, financial statements
What amount should be debited to the asset account : At the time the machine was purchased, the market rate of interest was 8%. What amount should be debited to the asset account
Explain who created each work of architecture or sculpture : Explain who created each work of architecture or sculpture? Who commissioned its creation? What was the function of each object at the time of its creation?
Create a function which configures the three pulse : Create a function, void Init_PWM(void) which configures the 3 pulse width modulation signals. Use Timer B.
Advice regarding the proper tax treatment of this gain : During the current year, he was able to sell 10 parcels at a net profit of $400,000. Ted would like your advice regarding the proper tax treatment of this gain
What advice would you give jim : Jim Brown is a dairy farmer in Wisconsin. He had a herd of 200 cows and sells milk to the local farm cooperative. What advice would you give Jim
How do health providers design educational programs : How do health providers design educational programs to clearly articulate objectives to engage both patients as well as families?
What is the net cash balance per books after reconciliation : Hercules Co.'s monthly bank statement shows a balance of $22,300. What is the net cash balance per books after the reconciliation

Reviews

Write a Review

Other Engineering Questions & Answers

  Pseudoplastic and a newtonian fluid please

A Bingham plastic, a dilatant, a pseudoplastic and a Newtonian fluid Please?

  Plot frequency-gain dependence plot using plotting software

Write a report that summarizes this experiment. Your report brief must include: Plot the frequency-gain dependence plot using a plotting software (such as excel) and include it in your lab report.

  Determining the total mass of the car

Consider a 1400-kg car cruising at constant speed of 70 km/h. Now the car starts to pass another car, by accelerating to 110 km/h in 5 s. Determine the additional power needed to achieve this acceleration. What would your answer be if the total ma..

  What volumetric flow rate is needed to produce

The propulsive force (thrust) developed to propel the jet ski shown in Fig. is a result of water pumped through the vehicle and exiting as a high-speed water jet. For the conditions shown in the figure, what volumetric flow rate is needed to produ..

  Consolidation test experiment

write just an introduction and methodology about Consolidation Test Experiment,

  Show the states of all blocks that are changed by operation

In the state after the above operation, show the states of all the blocks that are changed by operation P0: write 128

  Dc analysis of transistor and dc load line

For the common emitter circuit shown below (see figure 1) the parameters are: VBB = 4 V, RB = 220 kΩ, RC = 2 kΩ, VCC = 10 V, VBE(on) = 0.7 V, and β = 200. Calculate the base current (IB), collector current (IC), emitter currents (IE), the VCEvoltage ..

  What was the braking efficiency of the car

Ignoring air resistance, and using theoretical stopping distance, what was the braking efficiency of the car?

  Define the rigid transformations

E28: Mobile Robotics - Fall 2015 - HOMEWORK 2. Define the rigid transformations TWA, TWB, TLA, and TCB at time t = 0 in terms of their rotation matrix R and translation vector t. You should explicitly write out all of the matrix and vector elements

  Topic- how facebook is changing our way of communicationkey

topic- how facebook is changing our way of communication.key words- facebook- changing- communicationkey questions- how

  What is the minimum effective green time

What is the minimum effective green time needed for this cycle to have zero vehicles in the queue when the effective red of the next cycle starts and what is the total delay in this cycle

  Proportional to the data signal

Evaluate the loop filter output, assuming that this filter removes only modulated components with carrier frequency 2fc. Show that this output is proportional to the data signal m(t) when the loop is phase locked, that is, ?(t) = 0.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd