Menu

Setting output ports on pic10f

2009-11-27
2013-05-30
  • Alistair George

    Alistair George - 2009-11-27

    Hi I tried this:
    dir GP0 out
    dir GP1 out
    dir GP2 out
    compiles OK GCB, but using MPASM:
    Error   G:\DEV\PIC\GCBASIC\COMPILED.ASM 72 : Argument out of range (1 not between 5 and 9)
    Error   G:\DEV\PIC\GCBASIC\COMPILED.ASM 74 : Argument out of range (2 not between 5 and 9)
    By manual assembler it works:
    movlw 0x08
    TRIS GPIO 'GP0, GP1, GP2 as output.

    Anyone please advise how I should set ports for output on this limited micro using GCbasic? Or must one use the ASM method above?
    Thanks.

     
  • kent_twt4

    kent_twt4 - 2009-11-28

    GCBasic syntax for the Baseline (i.e.12bit including the 10f) PIC devices, the TRIS or GPIO Port direction needs to be set all at once like your asm:

        dir GPIO b'001000'

     

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.