| Electronic Components Datasheet Search |
|
RM0312 Datasheet(PDF) 127 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
RM0312 Datasheet(HTML) 127 Page - STMicroelectronics |
|
127 / 275 page ![]() DocID022352 Rev 3 127/275 RM0312 16-bit general purpose timer (TIM2/TIM3) 170 Starting 2 timers synchronously in response to an external trigger In this example, we set the enable of Timer A when its TI1 input rises, and the enable of Timer B with the enable of Timer A. Refer to Figure 42 for connections. To ensure the counters alignment, Timer A must be configured in master/slave mode (slave with respect to TI1, master with respect to Timer B). 1. Configure Timer A master mode to send its Enable as trigger output (MMS=001 in the TIMx_CR2 register). 2. Configure Timer A slave mode to get the input trigger from TI1 (TS=100 in the TIMx_SMCR register). 3. Configure Timer A in trigger mode (SMS=110 in the TIMx_SMCR register). 4. Configure the Timer A in Master/Slave mode by writing MSM=’1’ (TIMx_SMCR register). 5. Configure Timer B to get the input trigger from Timer A (TS=001 in the TIMx_SMCR register). 6. Configure Timer B in trigger mode (SMS=110 in the TIMx_SMCR register). When a rising edge occurs on TI1 (Timer A), both counters starts counting synchronously on the internal clock and both TIF flags are set. Note: In this example both timers are initialized before starting (by setting their respective UG bits). Both counters starts from 0, but you can easily insert an offset between them by writing any of the counter registers (TIMx_CNT). You can see that the master/slave mode insert a delay between CNT_EN and CK_PSC on Timer A. Figure 47. Triggering Timer A and B with Timer A TI1 input 00 01 fMASTER Timer A-CEN = CNT_EN Timer A-CNT Timer A-TI1 Timer A-CK_PSC 02 03 04 05 06 07 08 09 Timer A-TIF 00 01 Timer B-CEN = CNT_EN Timer B-CNT Timer B-CK_PSC 02 03 04 05 06 07 08 09 Timer B-TIF |
|
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 |