| Electronic Components Datasheet Search |
|
HT56R26 Datasheet(PDF) 47 Page - Holtek Semiconductor Inc |
|
|
|||||||||||||||||||||||||||||
HT56R26 Datasheet(HTML) 47 Page - Holtek Semiconductor Inc |
|
47 / 131 page ![]() HT56R22/HT56R23/HT56R24/HT56R25/HT56R26 Rev. 1.00 47 March 11, 2010 Configuring the Timer/Event Counter Input Clock Source The internal timer ¢s clock can originate from various sources. The system clock source is used when the Timer/Event Counter is in the timer mode or in the pulse width measurement mode. For the 8-bit Timer/Event Counter this internal clock source is fSYS which is also di- vided by a prescaler, the division ratio of which is condi- tioned by the Timer Control Register, TMRnC, bits TnPSC0~TnPSC2. For the 16-bit Timer/Event Counter this internal clock source can be chosen from a combi- nation of internal clocks using a configuration option and the TnS bit in the TMRnC register. An external clock source is used when the timer is in the event counting mode, the clock source being provided on an external timer pin TMR0, TMR1, TMR2 or TMR3 depending upon which timer is used. Depending upon the condition of the TnE bit, each high to low, or low to high transition on the external timer pin will increment the counter by one. Device All Devices No. of 8-bit Timers 3 Timer Name Timer/Event Counter 0 Timer/Event Counter 2 Timer/Event Counter 3 Timer Register Name TMR0 TMR2 TMR3 Control Register Name TMR0C TMR2C TMR3C No. of 16-bit Timers 1 Timer Name Timer/Event Counter 1 Timer Register Name TMR1L/TMR1H Control Register Name TMR1C Timer Registers - TMR0, TMR1L/TMR1H, TMR2, TMR3 The timer registers are special function registers located in the Special Purpose Data Memory and is the place where the actual timer value is stored. For the 8-bit Timer/Event Counters, these registers are known as TMR0, TMR2 or TMR3. For the 16-bit Timer/Event Counter, a pair of regis- ters are required and are known as TMR1L/TMR1H. The value in the timer registers increases by one each time an internal clock pulse is received or an external transition oc- curs on the external timer pin. The timer will count from the initial value loaded by the preload register to the full count of FFH for the 8-bit timer or FFFFH for the 16-bit timer at which point the timer overflows and an internal interrupt signal is generated. The timer value will then be reset with the initial preload register value and continue counting. To achieve a maximum full range count of FFH for the 8-bit timer or FFFFH for the 16-bit timer, the preload reg- isters must first be cleared to all zeros. It should be noted that after power-on, the preload register will be in an unknown condition. Note that if the Timer/Event Counter is switched off and data is written to its preload registers, this data will be immediately written into the actual timer registers. However, if the Timer/Event Counter is enabled and counting, any new data written into the preload data registers during this period will re- main in the preload registers and will only be written into the timer registers the next time an overflow occurs. For the 16-bit Timer/Event Counter which has both low byte and high byte timer registers, accessing these reg- isters is carried out in a specific way. It must be noted when using instructions to preload data into the low byte timer register, the data will only be placed in a low byte buffer and not directly into the low byte timer register. The actual transfer of the data into the low byte timer register is only carried out when a write to its associated high byte timer register, namely TMR1H, is executed. On the other hand, using instructions to preload data into the high byte timer register will result in the data be- ing directly written to the high byte timer register. At the same time the data in the low byte buffer will be trans- ferred into its associated low byte timer register. For this reason, the low byte timer register should be written first when preloading data into the 16-bit timer registers. It must also be noted that to read the contents of the low byte timer register, a read to the high byte timer register must be executed first to latch the contents of the low byte timer register into its associated low byte buffer. Af- ter this has been done, the low byte timer register can be read in the normal way. Note that reading the low byte timer register will result in reading the previously latched contents of the low byte buffer and not the actual con- tents of the low byte timer register. |
|
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 |