how many pwm on the 28x2

rob nash

Senior Member
hello all,
i been reading the updated manuals, while looking over at a glance
the pinout diagrams of the X2 parts it appears that the new 28x2 has 4 pwm outputs C.1,C.2,B.5,B.0, is this right.

cheers rob
 

hippy

Technical Support
Staff member
That's correct. The older 28X2-5V and 28X2-3V had two, the new has four, each controllable by their own PMWOUT commands - the divisor / frequency is shared by C.0 and C.2, separate to B.0 and B.5.

Take care not to confuse PWMOUT with HPWM channels and their respective pins! The four HPWM are effectively driven from one PWMOUT channel.
 

Adamey

Senior Member
I just noticed that. So the 40X2 only has 2? I would have thought the 40X2 would have the same (or more), but I guess not.
 

Technical

Technical Support
Staff member
The 40X2 currently still has two pwm channels, due to the design of the silicon which is beyond PICAXE firmware control. We hope to address this in the future with new silicon developments with Microchip.
 

rob nash

Senior Member
pwmout

good morning from sunny north west i,ve been playing with the new 28x2 b.3. and am trying to fade some leds i found the the pwm on b.0/b.5 does,nt like the commands pwmout/pwmduty which is driving me nuts.
so my Q. is it right b.0/b.5 can only use pwm commands only.
Code:
main:
 do
for w1 = 0 to 400
pwmout c.2,99,w1
 pause 20                    'increasing brightness
 next w1
 pause 1000

 
for w1 = 400 to 0 step -1
 pwmout c.2,99,w1
 pause 40                      'decreasing brightness
 next w1
 

pwmout c.2,99,0

 pause 1000
 for w1 = 0 to 400 
pwmout c.1,99,w1
 pause 40                          'increasing brightness
 next w1
 pause 1000

 
for w1 = 400 to 0 step -1
 pwmout c.1,99,w1
 pause 40                           'decreasing brightness
 next w1
 

pwmout c.1,99,0
pause 1000

 for w1 = 0 to 400 
pwm b.0,99,w1
 pause 40                          'increasing brightness
 next w1
 pause 1000

 
for w1 = 400 to 0 step -1
 pwmout b.0,99,w1
 pause 40                      'decreasing brightness
 next w1
 

pwmout c.1,99,0
 pause 1000
 loop

this code works for c.1,c.2

when i add b.0 i get this error

"pwmout b.0,99,w1
^
Error: Invalid pwmout pin (use C.1 or C.2)!"

any advice would be helpful
cheers rob
 

rob nash

Senior Member
hi hippy am using 5.3.3 and am crap at putting the patch in for 5.3.4
i,ve just checked the editor and it says it 5.3.1 so down loading it now thast what i get for having it installed on three computer
thanks hippy
 
Last edited:
Top