• AVR Freaks

Hot!PIC acts differently when Pickit3 is not connected

Author
didierleplae
Super Member
  • Total Posts : 189
  • Reward points : 0
  • Joined: 2019/03/31 16:57:50
  • Location: 0
  • Status: online
2019/12/05 11:41:58 (permalink)
0

PIC acts differently when Pickit3 is not connected

I’m having a strange issue with PIC16F1765 acting differently when I disconnect the Pickit3 even though I’m not powering from the Pickit..
For example, the LCD is only displaying blocks at first and subsequently things that don’t make sense.
The LCD is not connected to any of the programming pins that the Pickit3 uses.

I’m a bit baffled. I’m sure I’m doing something silly, but not sure what. Could it have something to do with the MCLR pin?
What is best to do with the MCLR when not in use?
#1

10 Replies Related Threads

    NorthGuy
    Super Member
    • Total Posts : 6311
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: offline
    Re: PIC acts differently when Pickit3 is not connected 2019/12/05 11:57:58 (permalink)
    0
    Usually this happens when your ground is not connected properly. PICkit3 provides ground, so everything works.
    #2
    crosland
    Super Member
    • Total Posts : 2041
    • Reward points : 0
    • Joined: 2005/05/10 10:55:05
    • Location: Warks, UK
    • Status: offline
    Re: PIC acts differently when Pickit3 is not connected 2019/12/05 12:05:04 (permalink)
    0
    didierleplae
    What is best to do with the MCLR when not in use?

    RTFM
    #3
    didierleplae
    Super Member
    • Total Posts : 189
    • Reward points : 0
    • Joined: 2019/03/31 16:57:50
    • Location: 0
    • Status: online
    Re: PIC acts differently when Pickit3 is not connected 2019/12/05 13:00:48 (permalink)
    0
    NorthGuy
    Usually this happens when your ground is not connected properly. PICkit3 provides ground, so everything works.

    I tried leaving the GND pin connected from the PICKIT and still getting the same results.
    Also, tried leaving both MCLR and GND connected.
    #4
    crosland
    Super Member
    • Total Posts : 2041
    • Reward points : 0
    • Joined: 2005/05/10 10:55:05
    • Location: Warks, UK
    • Status: offline
    Re: PIC acts differently when Pickit3 is not connected 2019/12/05 13:21:18 (permalink)
    0
    If the PIC is on a stand-alone board then it will not be a ground issue since it has no "ground"
     
    id you try connecting MCLR according to wha the data sheet tells you?
    #5
    NorthGuy
    Super Member
    • Total Posts : 6311
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: offline
    Re: PIC acts differently when Pickit3 is not connected 2019/12/05 13:45:54 (permalink)
    0
    MCLR should be Ok when unconnected because the PIC has internal pull-ups. If you have something connected to MCLR which pulls it low, it'll certainly reset the PIC.
    #6
    didierleplae
    Super Member
    • Total Posts : 189
    • Reward points : 0
    • Joined: 2019/03/31 16:57:50
    • Location: 0
    • Status: online
    Re: PIC acts differently when Pickit3 is not connected 2019/12/05 15:06:54 (permalink)
    +1 (1)
    crosland
    RTFM

    Point takengrin: grin
    #7
    didierleplae
    Super Member
    • Total Posts : 189
    • Reward points : 0
    • Joined: 2019/03/31 16:57:50
    • Location: 0
    • Status: online
    Re: PIC acts differently when Pickit3 is not connected 2019/12/05 15:11:19 (permalink)
    0
    crosland
    If the PIC is on a stand-alone board then it will not be a ground issue since it has no "ground"
     
    id you try connecting MCLR according to wha the data sheet tells you?


    So, now I'm able to get it to work, if I attach the GND pin from the PICKIT3 really close to the GND pin on my breadboard. I guess I must have been getting a sketchy connection. 
    The weird thing is, I must be getting GND from my power supply, otherwise nothing would work. I get the backlight on LCD no matter what
    #8
    ric
    Super Member
    • Total Posts : 28433
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: PIC acts differently when Pickit3 is not connected 2019/12/05 15:15:35 (permalink)
    +1 (1)
    I'm going to take a wild guess here.
    If your PK3 is connected, then it forces a reset of the PIC after power comes up, so it can read the device ID.
    If the PK3 is not connected, then your PIC will start running code as soon as power comes on.
    If your LCD has not finished starting up at this point, and if you don't have sufficient delays in your LCD init code, then this could fail.
    Try just adding a few 100ms delay to your startup code BEFORE you try to init the LCD.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #9
    crosland
    Super Member
    • Total Posts : 2041
    • Reward points : 0
    • Joined: 2005/05/10 10:55:05
    • Location: Warks, UK
    • Status: offline
    Re: PIC acts differently when Pickit3 is not connected 2019/12/06 06:05:55 (permalink)
    0
    didierleplae
    crosland
    If the PIC is on a stand-alone board then it will not be a ground issue since it has no "ground"
     
    id you try connecting MCLR according to wha the data sheet tells you?


    So, now I'm able to get it to work, if I attach the GND pin from the PICKIT3 really close to the GND pin on my breadboard. I guess I must have been getting a sketchy connection. 
    The weird thing is, I must be getting GND from my power supply, otherwise nothing would work. I get the backlight on LCD no matter what


    The ground connection to the PK3 is irrelevant unless the circuit on breadboard is also connected to some other equipment that has a ground connection. Otherwise the breadboard is floating and has no notion of what ground is.
     
    Using a breadboard may be the issue. Do you have short wires for the power and correct decoupling close to the PIC?
    #10
    oliverb
    Super Member
    • Total Posts : 286
    • Reward points : 0
    • Joined: 2009/02/16 13:12:38
    • Location: 0
    • Status: offline
    Re: PIC acts differently when Pickit3 is not connected 2019/12/06 13:40:34 (permalink)
    0
    Regarding MCLR both of the PICkit demo boards I have are fitted with a 10k resistor between MCLR and VCC. Not saying it is an absolute requirement, just that someone thought it was needed.
     
    Also regarding LCD timing a HD44780 datasheet gives the reset time as 10ms and recommends waiting 15ms after power on (specifically after VCC reaches 4.5v) in a 5v system, or 40ms after VCC reaches 2.7v.
    #11
    Jump to:
    © 2020 APG vNext Commercial Version 4.5