Programmable Pulse Generator in AVR ASM.

Status
Not open for further replies.

NewbProgrammer

Newbie level 1
Joined
Apr 15, 2013
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,296
Hello, I'm new to AVR Assembly, and I was needing help on getting an idea on how to program an AT tiny 2313 that matches the following description in AVR studio 4.

The Micro Controller Unit will generate a pulse that is started by an external interrupt. The pulse duration will be determined by an 8-bit number input on port B. The 8-bit number will be compared with a counter that will be incremented every 200 mS. This will set the pulse time from 0 to a little over 50 seconds in increments of 0.2 seconds.


When an external interrupt is triggered, the interrupt routine will read the PortB input value, turn on an LED connected tp portD6, load a starting value in a timer and start the timer. If the value on PortB is zero it should return without turning on the LED or starting the timer. The interrupt should be triggered when releasing the push button.


When the timer overflows it will trigger and interrupt. In the interrupt routine the timer will need to be loaded with a starting value.

The interrupt routine will increment a counter. The counter will be compared with the 8-bit value that was read on the PortB input pins. When the counter equals the 8-bit number, the output pulse will be turned off and the timer will be stopped.


Another External Interrupt will be configured with a routine that will tuirn off the output pulse and stop the timer. This routine can be used when the pulse duration has elapsed also. This interrupt should be triggered when pressing the button.


Any thoughts would be much appreciated.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…