Menu

trouble with 10F202 (GCBasic Version 0.9.1.0)

2006-09-25
2013-05-30
  • Stefano Delfiore

    I tried to use the pic 10F202, but I found some problems.
    '
    I was not able to define the I/O, I tried in different ways like:
    DIR PORTIO0.0 OUT
    DIR IO0.0 OUT
    DIR b'00001000'
    but I always got errors in compiled.lst
    '
    I was not able to set register OPTION.

    So I thought to use assembler to overcome the two problems:

    movlw b'00001000'
    tris 0x6
    movlw b'00001000'
    option

    the assembler code at output is:

    ;Start of the main program
        movlw    B'00001000'
    TRIS    0X6   
        movlw    B'00001000'
    OPTION       
    BASPROGRAMEND       
        sleep   
        goto    $
    --------------------
    Keywords TRIS and OPTION are in the first column as labels so I am again in trouble.

    The last problem is that GCbasic puts in compiled.asm the following code:

    ;Interrupt routine
        ORG    4
    INTERRUPT
    ;Interrupt code will be inserted here in a later version
        retfie   

    ;********************************************************************************

    but 10F202 doesn't have the interupt so in the file compiled.lst I have the following lines:
                   00021
                   00022 ;Interrupt routine
    0004           00023         ORG     4
    0004           00024 INTERRUPT
                   00025 ;Interrupt code will be inserted here in a later version
    Error [174] : Unknown opcode "retfie"
                   00026         retfie 
                   00027

    Regards
    Stefano

     
    • Hugh Considine

      Hugh Considine - 2006-09-26

      There appear to be some bugs in GCBASIC relating to 10F chips! I'll fix them within the next couple of days - thanks for telling me about them!

       
    • Hugh Considine

      Hugh Considine - 2006-09-26

      Those bugs should be fixed in the latest version (0.9.1.1) which I've just uploaded. "option" and "tris" are now recognized as valid assembly commands, and the "retfie" is only present on chips which can support interrupts. DIR now works on 10 and 12 chips.

      The DIR command cannot control individual bits on most smaller chips (including the 10F202). To use it, this is the syntax:

      DIR GPIO b'00001100'

       
    • Stefano Delfiore

      Thank you Hugh, I appreciate very much your effort to improve GCBasic. I really like GCbasic a lot.

      Regards
      Stefano

       

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.