Pic10F202 Master clear will not turn off.


Closed Thread
Results 1 to 23 of 23
  1. #1
    Join Date
    Apr 2013
    Posts
    12

    Default Pic10F202 Master clear will not turn off.

    No matter what I try master clear will not turn off. I have done everything but change the device file as it says if it is listed in your code it over rides it. Need GPIO.3 as an input. Dumbed the program as much as I could. output pins go from high to low as should. But if I ground GPIO.3 everything resets.

    Code:
    #CONFIG
            __config _WDT_OFF & _MCLRE_OFF & _CP_OFF
    #ENDCONFIG
    
            OPTION_REG=000000
                        
            TRISIO = 001000
            
            A    VAR    GPIO.0
            B    VAR    GPIO.1
            C    VAR    GPIO.2
            IN    VAR    GPIO.3
            
            
    BEGIN:  high A
            high B
            high C
            pause 1000
            low A
            low B
            low C
            pause 1000
            gotO BEGIN

  2. #2
    Join Date
    Apr 2013
    Posts
    12


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    for some reason it changed my code so here it is again


    #CONFIG
    __config _WDT_OFF & _MCLRE_OFF & _CP_OFF
    #ENDCONFIG

    OPTION_REG=%01000000

    TRISIO = %00001000

    A VAR GPIO.0
    B VAR GPIO.1
    C VAR GPIO.2
    IN VAR GPIO.3


    BEGIN: high A
    high B
    high C
    pause 1000
    low A
    low B
    low C
    pause 1000
    gotO BEGIN

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,389


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    Code:
    #CONFIG
      __config  _IntRC_OSC & _WDT_OFF & _CP_OFF & _MCLRE_OFF
    #ENDCONFIG
    MY GUESS
    #CONFIG
    ^__config^_IntRC_OSC & _WDT_OFF & _CP_OFF & _MCLRE_OFF
    #ENDCONFIG

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    TRISIO = 001000
    should anything hurt you ???

    me does !!!

    try to use A = 1, B = 1 ... etc, etc
    instead of HIGH and LOW Commands ...

    Alain

    PS: Oooops ...
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5
    Join Date
    Apr 2013
    Posts
    12


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    richard,
    are you saying add carrots? around __config ?

    Alain,

    I agree I normally use var = x also, and not High and low but just wrote something quick and that is faster. and GPIO.0-.2 do as they are told. So that part is working memory clear just won't enable as an input. So irritating.

    Thanks again,
    Joe

  6. #6
    Join Date
    Jan 2013
    Location
    Texas USA
    Posts
    229


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    No I think that Richard was trying to tell you that there were too many spaces.

    It should look like this " __config _IntRC_OSC & _WDT_OFF & _CP_OFF & _MCLRE_OFF"

    Notice, (1) space before __config and (1) space between __config and _IntRC_OSC
    Regards,
    TABSoft

  7. #7
    Join Date
    Apr 2013
    Posts
    12


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    I think the spaces were added when I copy and pasted it. as it screwed up other formating as well. But I will check and get back to you.

  8. #8
    Join Date
    May 2013
    Location
    australia
    Posts
    2,389


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    No I think that Richard was trying to tell you that there were too many spaces.
    no I was indicating I thought that as tabsoft said

    Notice, (1) space before __config and (1) space between __config and _IntRC_OSC

    it gets difficult to show when the forum eats up the white space on your posts .
    post #2 shows no spaces

  9. #9
    Join Date
    Apr 2013
    Posts
    12


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    I appreciate the help guys. I had a tab then a space after. fixed to a space before and a space after but MCLR is still active. I even said the hell with it and changed it in the device folder and still no go. checked .asm file and looks like it is writing it right. Wish I could read the .hex I'm wondering if it is my programmer but I have programmed tons of other pics with no problems what so ever. Xeltek Superpro 580u

  10. #10
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    OK. According to page 35 of the 10F20x datasheet you can't change the config word that has the MCLRE bit in it. Will setting the fuse do that for you?

    I think I ran into this a while ago and was never able to use a 10F222 GPIO.3 as an input no matter what I did.

  11. #11
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    Is there any chance GPIO.3 is shorted to VDD ? Just asking because you did not mention if this is a PDIP or SMT package, in chk or not . . .
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  12. #12
    Join Date
    Apr 2013
    Posts
    12


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    avioncis,
    I did see page 35 and does not give memory location for some reason where the register 9-1 is at. Which I find weird. But there has to be one because the bits are writable says datasheet. But yes at this point it's not looking good.

    Arch,
    Sorry this is a DIP 8 pin package. vdd seems to be holding it high internally. as there is 5 volt on GPIO.3 with nothing connected. But I'm sure that is the way it is suppose to be. So it doesn't reset itself if someone didn't know they need a pull up resistor. And per data sheet if voltage greater than Vdd will enter programming mode. If you are saying that vdd is being applied externally accidentally no.

  13. #13
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    Ok sometimes finding out what it is is by eliminating everything else. So what does your volt meter tell you if you turn ON MCLRE ? Also do you have another chip?edit: (Almost)/edit Lastly are you SURE it is a Genuine PIC? I know it seems silly to entertain the idea of cloning a $0.38 chip but when you are selling 50 million of them . . .
    Data sheet says GPIO.3 is connected to VDD when MCLRE is off, I am trying to get my head around how it can serve as an input while connected to vdd unless it's via a WPU, . . . . How "ROBUST" is your power supply? Does grounding GPIO.3 cause the chip to BROWNOUT ? Also check your breadboard for corrosion causing weak connections, seen that many times.
    Last edited by Archangel; - 10th March 2015 at 03:33.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  14. #14
    Join Date
    Apr 2013
    Posts
    12


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    Gen pic bought from digikey. have three in rotation. all do the same. I have tried two bead boards. I just have Vdd and Vss hooked up. just metering the rest. using 1 kohm res to ground to reset mclre. chip does not brown out. power supply is 1 amp 5volt. clean on the scope. Pg 9 of data sheet says it can be enabled as GPIO.3 with pull ups or no pull ups. so it should not be tied to Vdd.

  15. #15
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    Code:
    ;----- CONFIG Options --------------------------------------------------
    _OSC_IntRC           EQU  H'0FFF'    ; This is the only option. It is here for backward compatibility
    _IntRC_OSC           EQU  H'0FFF'    ; This is the only option. It is here for backward compatibility
    
    _WDTE_OFF            EQU  H'0FFB'    ; WDT disabled
    _WDT_OFF             EQU  H'0FFB'    ; WDT disabled
    _WDTE_ON             EQU  H'0FFF'    ; WDT enabled
    _WDT_ON              EQU  H'0FFF'    ; WDT enabled
    
    _CP_ON               EQU  H'0FF7'    ; Code protection on
    _CP_OFF              EQU  H'0FFF'    ; Code protection off 
    
    _MCLRE_OFF           EQU  H'0FEF'    ; GP3/MCLR pin fuction is digital I/O, MCLR internally tied to VDD 
    _MCLRE_ON            EQU  H'0FFF'    ; GP3/MCLR pin function  is MCLR
    This is from this chips file in MPASM P10F202.inc

    Ok this is found on pp35 of the data sheet
    Last edited by Archangel; - 10th March 2015 at 04:09.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  16. #16
    Join Date
    Apr 2013
    Posts
    12


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    ya it says tied to vdd internally. It is still there it just isn't tristated to an external pin I believe.

    Anyways I think I have had some success last night. I found that Microcode was automatically changing my case on on #endconfig From #ENDCONFIG to #endconfig. and #CONFIG was staying #CONFIG. So I changed #CONFIG to #config. and doesn't seem to reset anymore on a low to GPIO.3. However I have pull ups off. and it still rests at vdd. and not getting ram over load error(which I find that you get if you add just one static variable). and will not respond as GPIO.3 as an input. (changed program to if "IN" = 1 alternate ports from high to low else stay low) and won't do it. And as soon as I introduce "IN" into the program program doesn't work. comment out. it will alternate. I guess I didn't do if IN=0. that would off been smart since seems internal pull ups are on even though OPTION_REG.6 is high which is suppose to disable them.
    Last edited by Elusiveinc; - 10th March 2015 at 14:14.

  17. #17
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    Honestly I didn't know ANY of the 10F series would even program with PBP due to RAM limitations, as I remember Darrel usually told members who wanted to try to use a 12F series. Any special reason to use 10F series?
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  18. #18
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    Hi,Archangel

    Darrel told that because there is no room for vars in RAM once PBP has placed its own vars ...

    so, no serious work could be done using PBP ... just Blinking the Led, may be ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  19. #19
    Join Date
    Apr 2013
    Posts
    12


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    Arch,
    just trying to keep cost down because I plan on producing high numbers. And program is going to be super simple. 12 lines tops. Anyone know of a way to strip one byte of ram? Any way of finding out if PBP3 uses the "w" or "f" register? maybe I can load and unload input into that.

    Alain,
    I hope you are wrong. haha!

  20. #20
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    I took your code from your first post and it compiled to 92 words
    changed to
    Code:
    #CONFIG
        __config _WDT_OFF & _MCLRE_OFF & _CP_OFF
    #ENDCONFIG
    DEFINE OSC 4
    OPTION_REG=%01000000
    
    TRISIO = %00001000
    
    A VAR GPIO.0
    B VAR GPIO.1
    C VAR GPIO.2
    IN VAR GPIO.3
    
    
    BEGIN:
    GPIO = %00000111
    pause 1000
    GPIO = %00000000
    pause 1000
    goto BEGIN
    it's down to 66 words

    if you add "END"
    it jumps to 78

    To see what your PBP code is doing look at the .lst file, that might help you.
    If my poor memory serves me I believe Darrel said PBP Library uses 14 bytes of memory and you have a total of 24 for this chip.
    Last edited by Archangel; - 10th March 2015 at 20:28.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  21. #21
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    Quote Originally Posted by Elusiveinc View Post

    Alain,
    I hope you are wrong. haha!
    not that wrong ...
    http://www.picbasic.co.uk/forum/show...8753#post18753

    yess ... that's short !

    seen ?
    In PBP, the 10F202 uses PBPPIC12.RAM, which requests 19 bytes of RAM for PBP system use. The 10F200 only has 16 total bytes of RAM available so it looks like it is a no go with PBP unless you want to do a lot of custom stuff.
    from here : http://www.picbasic.co.uk/forum/show...1725#post71725
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  22. #22
    Join Date
    Jan 2013
    Location
    Texas USA
    Posts
    229


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    Have you looked into a 12Fseries instead of using the 10F202?

    Quite a bit of functionality added for just a few cents difference.
    Something like the 12F1571?

    12F1571-I/P (8pin Dip) .64 cents per unit Qty 1-25
    1KWord Flash, 128Bytes RAM, (6) I/O Ports, (2/4) 8-Bit/16-Bit Timers, (1) Comparator, (3) 16-Bit PWM, (4) 10-Bit ADC ch

    10F202-I/P (8pin Dip) .57 cents per unit Qty 1-25
    512W Flash, 24Bytes Ram, (4) I/O Ports, (1) 8-Bit timer
    Regards,
    TABSoft

  23. #23
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Pic10F202 Master clear will not turn off.

    Elusiveinc,
    This is what I use for a program to operate a third tail light. It uses a 10F222.
    asm
    __CONFIG _MCLRE_OFF & _CP_OFF & _WDT_OFF & _IOFSCS_4MHZ
    movwf OSCCAL ; load factory osccal value at start-up
    bcf OSCCAL,0 ; Set GP2 as I/O pin
    ENDASM
    Dave Purola,
    N8NTA
    EN82fn

Similar Threads

  1. Replies: 2
    Last Post: - 24th February 2011, 01:35
  2. turn-off lcd and turn-on again
    By mehmetOzdemir in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 5th September 2009, 12:57
  3. GP3 Funtion on PIC10f202
    By kessral in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 10th March 2009, 19:49
  4. Does CLEAR Command clear return adrress of a subroutine?
    By sayzer in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 19th February 2008, 16:25
  5. PIC10F202 Variable trouble
    By George in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 13th October 2006, 02:14

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts