Menu

Softpwm out help

Help
2009-01-14
2013-05-30
  • Nobody/Anonymous

    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?

     
    • kent_twt4

      kent_twt4 - 2009-01-14

      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

       
    • Nobody/Anonymous

      now i get this:
      compiled.asm:159:Error [113] Symbol not previously defined (CHS2).
      compiled.asm:180:Error [113] Symbol not previously defined (CHS2).
      ?

       
    • kent_twt4

      kent_twt4 - 2009-01-15

      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

       
    • Nobody/Anonymous

      that did it thanks

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.