lab10_prelab

Lab10_prelab - buttons device should not be in the top level code 3 Use the LCD to display the values for the period and current duty cycle

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE 332L Microprocessors Lab Lab 10 Pre-Lab Fall 2009 Software Pulse-Width Modulation Write code to implement software Pulse-Width Modulation. Your code should have the following features. 1. The value for the period (T) can be hard coded in your source code with a #define statement near the top of the PWM source file or by passing it as a parameter to a PWM initialization function. 2. Use two buttons with edge capture to increment and decrement the duty cycle by an amount defined by a #define statement (this will be the PWM resolution). Use encapsulation to do the checking for these button pushes (i.e. the code for accessing the
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: buttons device should not be in the top level code. 3. Use the LCD to display the values for the period and current duty cycle. Suggested API: void pwm_init( unsigned int period, unsigned int ontime, unsigned int direction); unsigned int pwm_incr ( void ); unsigned int pwm_decr ( void ); unsigned int pwm_enable ( void ); unsigned int pwm_disable ( void ); Most of the above functionality should be completed before coming to lab on Tuesday. The remainder of the instructions for the lab will be posted by lab time on Tuesday....
View Full Document

This note was uploaded on 10/11/2011 for the course ECE 332 taught by Professor Staff during the Fall '08 term at Boise State.

Ask a homework question - tutors are online