Menu

setting pullups 10F200, command not recognized.

Help
2015-02-10
2015-02-11
  • tony golding

    tony golding - 2015-02-10

    i am currently playing with a few different chips with gcb and seem to have an issue with setting the internal weak pullups on a 10F200, a bland boring and featureless chip i know but still supprisingly usefull for me.

    as part of a learning curve with a new language i like to learn by just going through setting and testing the chips features just to get acquainted with the language as that seems to help.

    i am just wanting to enable the weak internal pullups so i can get on with adding some code.

    the only reference i found was this thread:
    https://sourceforge.net/p/gcbasic/discussion/579126/thread/d9b9d558/?limit=25#b082

    i have inserted that into the program up top with the rest of the setup data but it will not pass a compile, if i remove it then all is good.

    ; FILE: pic10Fxxx functions test/weak pullup.gcb

    ;
    ; ----- Configuration
    #chip 10F200, 4
    #config MCLRE = OFF,CP = OFF,WDT = OFF

    ; ----- define ports
    #define led_1 GPIO.0
    #define led_2 GPIO.1
    #define bttn GPIO.3

    ; ----- set port directions
    dir led_1 out
    dir led_2 out
    dir bttn in

    set NOT_GPPU, off

    ; ----- Main body of program commences here.

    do
    
    
    loop
    

    theres nothing to it at the moment as i was checking it would compile for errors so no point adding main code until i can use the pullups.

    so it seems that i have presumably missed something then?
    thats the command as in the 10F200.dat file i checked it so am i just using a wrong command before it?

    using current version of gcb@syn

    tony

     

    Last edit: tony golding 2015-02-10
  • kent_twt4

    kent_twt4 - 2015-02-10

    Looks like a typo. NOT_GPPU has a comma attached :).

     
  • tony golding

    tony golding - 2015-02-11

    even without the comma and just set NOT_GPPU off it still gives an error:

    Error: GCASM:bad ORG overwriting location 0

    tony

     
  • kent_twt4

    kent_twt4 - 2015-02-11

    My apologies, it has been quiet some time since I've played with the 10f's. An unattended consequence of clearing the NOT_GPPU bit, is gcasm makes the OPTION register a variable (Not Good). To my recollection OPTION in assembler is special kind of operator, it automatically loads the W register. So the answer is to use some assembler, get used to it if you intend to get much beyond a blinky led :). This now compiles:

    #chip 10F200, 4
    #config MCLRE = OFF ,WDT = OFF CP = OFF
    
    ; ----- define ports
    #define led_1 GPIO.0
    #define led_2 GPIO.1
    #define bttn GPIO.3
    
    ; ----- set port directions
    dir led_1 out
    dir led_2 out
    dir bttn in
    
    ;set NOT_GPPU off
    movlw   b'10001111'
    option
    ; ----- Main body of program commences here.
    
    do
    
    loop
    
     
  • tony golding

    tony golding - 2015-02-11

    thank you for the solution kent, i tried a 10f322 last night after the initial test with this chip and that one appears ok for the pullup commands so just this 10f200 is a bit more picky lol.

    tony

     
  • kent_twt4

    kent_twt4 - 2015-02-11

    The baseline chips are a real challenge. GCBasic does a good job of structuring the work flow, like loops and conditionals. It's when you start using delays and math that the variables start piling up, and code space gets crimped. Then you start having to be creative.

    The 10f322 is a fantastic little chip.

     
  • Chuck Hellebuyck

    Yes, Agree with Kent
    If you want to work with the PIC10F, then the PIC10F320 and 322 should be your choice. They are both midrange core parts (14 bit core vs 12 bit core for baseline) with all the latest features including interrupts.
    Baseline parts are very limited.

     
  • tony golding

    tony golding - 2015-02-11

    thanks guys, i will more than likely end up using the 10f322, its so feature packed and being available in sot 23-6 is very handy for my unhealthy smd addiction lol.

    thanks for the help with this one.

    tony

     

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.