Mega2560 PWM on channels 10-12

Discussion of issues related to writing ZBasic applications for targets other than ZX devices, i.e. generic targets.
Post Reply
kurakaira
Posts: 77
Joined: 21 March 2007, 1:21 AM
Location: Finland

Mega2560 PWM on channels 10-12

Post by kurakaira »

Can't open PWM channels 10-12 on the Mega2560 , what am i missing , Timer5 should not be used anywhere ...

Code: Select all

Const PwmTaajuusCS as single = 400.0 'Hz fine for leds
Call OpenPWM(4, PwmTaajuusCS, zxFastPWM, OnniTF) ' ch4-6
If OnniTF = False Then Debug.Print "Can't open PWM 4-6 !"
' Returns True
Call OpenPWM(10, PwmTaajuusCS, zxFastPWM, OnniTF) ' ch10-12
If OnniTF = False Then Debug.Print "Can't open PWM 10-12 !"
' Returns False
Last edited by kurakaira on 30 December 2019, 3:50 AM, edited 1 time in total.
kurakaira
Posts: 77
Joined: 21 March 2007, 1:21 AM
Location: Finland

Post by kurakaira »

Timer5 is not busy , but still unable to open PWM ch10-12 . . .
My board uses 9 PWM channels , and i could use Timer4 but i also need 1Wire so i can't spare the I/O Timer . . .
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

I apologize for the tardy reply.

Offhand, I don't know what the problem is but I will look into it.
- Don Kinzer
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

I believe that I found the problem and fixed it but we haven't tested it extensively. You can try the experimental version of the ZBasic Library code for the mega2560 that is in the attached .zip file.

To use it, first rename the existing libmega2560.a file in the zlib/avr/lib subdirectory of the ZBasic installation directory and then copy the same-named file from the .zip file to that directory.
Attachments
zlib_4-3-6_mega2560.zip
mega2560 update
(86.29 KiB) Downloaded 366 times
- Don Kinzer
kurakaira
Posts: 77
Joined: 21 March 2007, 1:21 AM
Location: Finland

Re: Mega2560 PWM on channels 10-12

Post by kurakaira »

Update has worked well !
Thanks !
Post Reply