Instructions

376Libraries
© 2013 Conrad Electronic
5.26.1.25
Timer_T1PWM
Timer Functions
Syntax
void Timer_T1PWM(word period, word PW0, byte PS);
Sub Timer_T1PWM(period As Word, PW0 As Word, PS As Byte)
Description
This function initializes Timer_1 with given period duration, pulse width and prescaler, see table. The out-
put signal is generated at Mega32: PortD.5 (PIN19), Mega128: PortB.5 (X1_3). There is an extended pres-
caler definition for the Mega128, see table.
For the pulse width parameters do not use the value zero. See Pulse Width Modulation
Parameter
period period duration
PW0 pulse width
PS prescaler
Table prescaler:
Prescaler
Tickduration Mega32 + Mega128
Tickduration Mega128 CAN
PS_1 (1)
67,8 ns
62,5 ns
PS_8 (2)
542,5 ns
500 ns
PS_64 (3)
4,34 µs
4 µs
PS_256 (4)
17,36 µs
16 µs
PS_1024 (5)
69,44 µs
64 µs
5.26.1.26 Timer_T1PWMX
Timer Functions
Syntax
void Timer_T1PWMX(word period, word PW0, word PW1, byte PS);
Sub Timer_T1PWMX(period As Word, PW0 As Word, PW1 As Word, PS As Byte)
Description
This function initializes Timer_1 with given period duration, prescaler, pulse width for channel A and B. The
output signal is generated at
Mega32: PortD.4 (PIN18) and PortD.5 (PIN19). Mega128: PortB.5 (X1_3) and PortB.6 (X1_2).
For the pulse width parameters do not use the value zero. See Pulse Width Modulation