PWM on 20M

maitchy

Member
20M limitations

I am surprised that the picaxe 20m does not support any pwm output - it is quite a disappointing problem for me (and I would have thought it could do anything the 14M could do, but have a few more pins to play with). Speaking of pins, according to manual 2 Version 6.2 01/2008, it doesn't seem to support the "pins" command either?

The way the 08M, 14M and 20M pins are arranged make them LOOK as though you'd be able to painlessly upgrade from one to another, or have a pcb that could take any of them; it would be nice if the software allowed for that sort of compatibility/migration - to the extent that a program could be used on a larger chip without manual changes even (even if that means the editor accepting a reference to some port C pin and adjusting it to a different pin if it knows it is downloading to a 20M).

Does the lack of some 08/08M/14M features mean the 20M has any memory left over, by the way? Is there a suggestions box for new firmware versions?? :)
 

Technical

Technical Support
Staff member
The 20M does support use of the pins command e.g. let pins = xx Thanks for pointing out the manual error.

The lack of pwmout command is due to the raw PIC functions, the chip used simply does not have an internal pwm module. Adjusting PICAXE firmware can therefore not 'add' this feature.

Unfortunately no spare memory! The pwmout command is an internal Microchip PIC feature (on supported chips) and so uses very little firmware space, and on the 20M these few bytes are required for processing the more complex port structure.
 
Last edited:

maitchy

Member
pwm continued...

Could the 20M do even a pwm like the old picaxe 08? Even without pwmout and hpwm it would be good to have something that can output something I can use for D-to-A. I think the 16F677 can do this: If an interrupt routine tied to timer1 interrupts simply did a pulsout, that would be good enough; I cannot implement anything like it in basic because it would be too slow.

Related to this... could a future picaxe implement a simple "arbitary waveform generator" output, where one or several output pins cycle through a list of values each time the timer interrupts (in the background, so it carries out normal programme flow all the time and the timing of the output wave is as exact as possible). This would be sort of a generalisation of music output and hpwm (although would chew a bit of CPU time I guess). The value of this would be to allow interesting signal generators, sound effects, good sinewaves, video signals, etc.
 
Top