This preview shows page 1. Sign up to view the full content.
Unformatted text preview: h
a) Must TIMER1 be setup as a Timer or as a Counter? Explain your answer! b) Write the code that sets up TIMER1 as a timer or counter following your answer
under (a) and causes an interrupt to be generated every 30 pushes. c) Given the initialization under (b) write the Interrupt Service Routine (ISR) that
that toggles the red LED every 30 pushes of the push button and toggles the
green LED every 60 pushes (= 2*30 pushes) of the push button.
Take a good look at what happens to the least significant two bits of PORTC. Problem 6.
Suppose TIMER 1 is used to “tag” data coming in on another port with a 2-byte
(TMR1H and TMR1L) time value. Show what we must do to make sure that the correct
time is read from the TIMER 1 registers (TMR1H and TMR1L) and stored in TAGH
(memory location 0x21) and TAGL (memory location 0x20), respectively. Provide the
assembly code for this time tag subroutine necessary to achieve this? 2...
View Full Document
This document was uploaded on 01/22/2014.
- Fall '14