| Electronic Components Datasheet Search |
|
ATPL00B Datasheet(PDF) 55 Page - ATMEL Corporation |
|
|
|||||||||||||||||||||||||||||
ATPL00B Datasheet(HTML) 55 Page - ATMEL Corporation |
|
55 / 152 page ![]() Atmel ATPL00B [datasheet] 43028A-ATPL - 9/12 55 For a 11.0592 MHz system clock, timer 2 has a programmable frequency range of 7.03 Hz to 1.8432 MHz. The generated clock signal is brought out to the T2 pin (P4.6). Timer 2 is programmed for the clock-out mode as follows: 1. Set the T2OE bit in T2MOD. This gates the timer register overflow to the ÷2 counter. 2. Clear the C/T2 bit in T2CON to select FOSC/3*(T2PRE(1:0)+1) as the timer input signal. This also gates the output of the ÷2 counter to pin T2. 3. Determine the 16-bit reload value from the formula and enter in the RCAP2H/RCAP2L registers. 4. Enter a 16-bit initial value in timer register TH2/TL2. This can be the same as the reload value, or different, depending on the application. 5. To start the timer, set the TR2 run control bit in T2CON. Clock-out mode timer 2 operation is similar to timer 2 operating as a baud rate generator. Moreover, it is possible to use timer 2 as a baud rate generator and a clock generator simultaneously. For this configuration, the baud rates and clock frequencies are not independent since both functions use the values in the RCAP2H and RCAP2L registers The baud rate is expressed by the following formula: 5.2.5 Baud rate Generator mode This mode configures timer 2 as a baud rate generator for its use with the serial ports. Select this mode by setting the SSI(1:0) bits in T2CON. Timer 2 may be selected as the baud rate generator for the transmitter and/or receiver in modes 1 and 3. The timer 2 baud rate generator mode is similar to the auto-reload mode. A rollover in the TH2 register reloads registers TH2 and TL2 with the 16-bit value in registers RCAP2H and RCAP2L, which are preset by software. The timer 2 baud rate is expressed by the following formula: Where “BAUD2” is the bit in the Special Function Register CONF and RCAP2(H,L) denotes the content of RCAP2H and RCAP2L taken as a 16-bit unsigned integer. To select timer 2 as baud rate generator for transmision and reception, program the SSI(1:0) bits in the T2CON register as shown in Table 5-1. Setting SSI(1) and/or SSI(0) puts timer 2 into its baud rate generator mode. In this mode, a rollover in the TH2 register does not set the TF2 bit in the T2CON register. Also, a high-to-low transition at the T2EX pin sets the EXF2 bit in the T2CON register but does not cause a reload from (RCAP2H, RCAP2L) to (TH2, TL2). User shall use the T2EX pin as an additional external interrupt by setting the EXEN2 bit in T2CON. Turn the timer off (clear the TR2 bit in the T2CON register) before accessing registers TH2, TL2, RCAP2H, and RCAP2L User shall configure timer 2 as a timer or a counter. In most applications, it is configured for timer operation (i.e., the C/T2 bit is clear in the T2CON register). Note that timer 2 increments every 1, 2, 3 or 4 state times (3TOSC) when it is in the baud rate generator mode. |
|
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 |