Page 1 of 1

PWM channels swapped?

Posted: 17 July 2008, 14:26 PM
by pjc30943
On a 1280n, based on the documentation the following should output PWM on L.3, L.4:

Code: Select all

OpenPWM 7, SERVO_REFRESH_RATE, zxCorrectPWM		
PWM 7, SERVO_PWM_CENTER_PERCENT	'0.0625
PWM 8, SERVO_PWM_CENTER_PERCENT

However the outputs are on H.3, H.4.

Perhaps the documentation is incorrect in the pins shown in the system library (pg.191)?


EDIT: the important thing is knowing which timers are used for channels 7,8: is it TMR5 associated with port H, or TMR4 associated with port L?

Re: PWM channels swapped?

Posted: 17 July 2008, 15:53 PM
by dkinzer
pjc30943 wrote:the important thing is knowing which timers are used for channels 7,8: is it TMR5 associated with port H, or TMR4 associated with port L?
The ZBasic documentation is incorrect. Channels 7-9 are associated with Timer4 and output on Port H while channels 10-12 are associated with Timer5 and output on Port L. The table should read:
[table][row]7[col]8[col]9[col]10[col]11[col]12
[row]15, H.3[col]16, H.4[col]17, H.5[col]38, L.3[col]39, L.4[col]40, L.5
[/table]