Pin Define
P1_3 = Timer3-CH0
P1_4 = Timer3-CH1
TIMER3 Output Compare Modes,Timer Free-Running Mode,3 - Set Output on Compare-Up,Clear on 0
1. Timer3-CH0(P1_3),Timer3-CH1(P1_4) initial state is LOW
2. Timer3 count from 0x00 to T3CC0(0xBF) and T3CC1(0x3F)
3. When Timer3 count to T3CC0,Timer3-CH0 (P1_3) state changes "LOW→HIGH"
4. When Timer3 count to T3CC1,Timer3-CH1(P1_4) state changes "LOW→HIGH"
5. When Timer3 count to 0xFF(Overflow),Timer3-CH0(P1_3) and Timer3-CH1(P1_4) return to the initial state and Timer3 recount
T3CC0=0xBF
T3CC01=0x3F
256(0xFF) / (16Mhz/128) = 2.048ms
TIMER3 Output
Compare Modes, Timer Modulo Mode,3 - Set Output on Compare-Up,Clear on 0
1. Timer3-CH1(P1_4) initial state is LOW
2. Timer3 count from 0x00 to T3CC1(0x3F)
3. When Timer3 count to T3CC1,Timer3-CH1(P1_4) state changes "LOW→HIGH"
5. When Timer3 count to T3CC0(Overflow),Timer3-CH1(P1_4) return to the initial state and Timer3 recount
T3CC1=0x3F
T3CC0=0xBF
T3CC1= 63(0x3F) / (16Mhz/128) = 0.504ms
T3CC0= 191(0xBF) / (16Mhz/128) = 1.528ms
TIMER3 Output
Compare Modes,Timer Up/Down Mode,3 - Set Output on Compare-Up,Clear on 0
1. Timer3-CH1(P1_4) initial state is LOW
2. Timer3 count from 0x00 to T3CC1(0x7F)
3. When Timer3 count to T3CC1,Timer3-CH1(P1_4) state changes "LOW→HIGH"
5. When Timer3 count to T3CC0(0xFF),Timer3 reverse count (decreasing)
6. When Timer3 reverse count to T3CC1(0x7F),Timer3CH1(P1_4) state changes "HIGH→LOW"
6. When Timer3 reverse count to 0x0000,Timer3-CH1(P1_4) return to the initial state and Timer3 recount
T3CC1=0x7F
T3CC0=0xFF
Note : TIMER4 same with TIMER3
沒有留言:
張貼留言