Menu

I can not program the 18F2620

Help
2015-01-16
2015-01-16
  • Diego Herranz

    Diego Herranz - 2015-01-16

    Which compile command are you executing?

    Here you can find up-to-date examples for pic14 (16F) and pic16 (18f). Maybe they're useful to you.
    https://github.com/diegoherranz/sdcc-examples

    Just a fast comments:

    • I think you can't access register bits directly (in pic14 port it's possible). Replace WREN with EECON1bits.WREN, RD3 with LATDbits.LATD3, etc.

    • It's better to include pic18fregs.h than pic18f2620.h. The compiler knows which model you're using and will select the correct header (code becomes more portable)

    • The way of defining fuses, changed. See the link with the examples or look for Configuration Bits on the pic16 section of SDCC manual.

    Regards,
    Diego

     

Log in to post a comment.