| Electronic Components Datasheet Search |
|
SH7721 Datasheet(PDF) 567 Page - Renesas Technology Corp |
|
|
|||||||||||||||||||||||||||||
SH7721 Datasheet(HTML) 567 Page - Renesas Technology Corp |
|
567 / 1524 page ![]() Section 14 Timer Unit (TMU) Rev. 3.00 Jan. 18, 2008 Page 505 of 1458 REJ09B0033-0300 14.3 Operation Each of the three channels has a 32-bit timer counter (TCNT) and a 32-bit timer constant register (TCOR). TCNT counts down. The auto-reload function enables synchronized counting. 14.3.1 Counter Operation When the STR0 to STR2 bits in the timer start register (TSTR) are set to 1, the corresponding timer counter (TCNT) starts counting. When TCNT underflows, the UNF flag in the corresponding timer control register (TCR) is set. At this time, if the UNIE bit in TCR is 1, an interrupt request is sent to the CPU. Also at this time, the value is copied from TCOR to TCNT and the down-count operation is continued. (1) Count Operation Setting Procedure An example of the procedure for setting the count operation is shown in figure 14.2. Select operation Select counter clock Set interrupt generation Set timer constant register Initialize timer counter Start counting (1) (2) (3) (4) (5) Note: When an interrupt has been generated, clear the flag in the interrupt handler that caused it. If interrupts are enabled without clearing the flag, another interrupt will be generated. (1) Select the counter clock with the bits TPSC2 to TPSC0 in the timer control register (TCR). (2) Use the UNIE bit in TCR to set whether to generate an interrupt when TCNT underflows. (3) Set a value in the timer constant register (TCOR) (the cycle is the set value plus 1). (4) Set the initial value in the timer counter (TCNT). (5) Set the STR bit in the timer start register (TSTR) to 1 to start counting. Figure 14.2 Setting Count Operation |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |