The example program is incorrect, and needs to be fixed.
Instead of 'dir softpwm1 out' you should use 'dir pwm_out1 out' etc., as that is what is defined as a port pin (i.e. #define pwm_out1 GPIO.1). Another way to keep track of your port pin directions; which in your case would be:
dir GPIO b'011001' ;where 0 is an output, and 1 is an input
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
now i get this:
compiled.asm:159:Error [113] Symbol not previously defined (CHS2).
compiled.asm:180:Error [113] Symbol not previously defined (CHS2).
?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i have:
#chip 12F675, 4 'mhz
#config OSC=INTOSC, MCLRE=off, WDT=off
#define pwm_out1 GPIO.1
#define pwm_out2 GPIO.5
dir gpio.0 in
dir softpwm1 out
dir gpio.4 in
dir softpwm2 out
Main:
do
pwmout 1, readad(an0), 50
pwmout 2, readad(an3), 50
loop
but i get errors saying"(8): SOFTPWM1 is not a valid I/O pin or port, (10): SOFTPWM2 is not a valid I/O pin or port.?
why, what needs to change?
The example program is incorrect, and needs to be fixed.
Instead of 'dir softpwm1 out' you should use 'dir pwm_out1 out' etc., as that is what is defined as a port pin (i.e. #define pwm_out1 GPIO.1). Another way to keep track of your port pin directions; which in your case would be:
dir GPIO b'011001' ;where 0 is an output, and 1 is an input
now i get this:
compiled.asm:159:Error [113] Symbol not previously defined (CHS2).
compiled.asm:180:Error [113] Symbol not previously defined (CHS2).
?
Compiles fine on this end, so be sure that you have the (not so obvious?) latest 'update zip' installed; found here: http://gcbasic.sourceforge.net/update.html
that did it thanks