Menu

Help with PicKit 3

Help
Moto Geek
2018-06-28
2018-06-28
  • Moto Geek

    Moto Geek - 2018-06-28

    I was working on a board (known good) with a Pic18f23k22, and programming it using a pickit3 and MPlab IPE. I'm using the latest version of GCB with the PPtool. I have used this board before with the same pickit3 with an earlier version of GCB that did not have the PPtool, using the IPE Pusher in the batch file. When using the older version and the pusher, everything worked just dandy. I would program the board, removed the pickit3 and the unit worked perfectly.

    So I needed to modify the program after installing the new GCB. After programming, the program would run perfectly. Once I removed the Pickit 3 from the board and power cycled, nothing happened. So I reattached the pickit 3, reprogrammed, ran the program all is good. Disconnected the pickit 3, cycled power, nothing... So this unit would only run while the pickit 3 was connected to the ICSP port of the board. Since I was just testing something for fun, I gave up and put the board away thinking it went bad.

    So today, I had to modify a program running another board with a Pic16f1825. This too was a known good board that was previously programmed with older GCB and pusher. The same exact thing is happening on this board. Unless the pickit 3 is attached to the ICSP port, the unit will not run after a power cycle. When I attach the pickit 3 and power cycle, it works great, but not when the pickit 3 is disconnected.

    What can possibly have changed between the last version of GCB and this one with the PPtool where the chip needs to have the pickit 3 attached to run? I have tried different settings in the IPE like hold in reset, release from reset, etc. and nothing is working unless the pickit 3 is attached.

    In GCB, I press the hex/flash button to program, the IPE says the program has been modified, I load it and press program. Everything works until I disconnect the pickit 3.

    In the programmer preferences, where it says "programmers to use (in order) I have
    MPLAB-IPE PK3 CLI: Program all_release from reset - Default

    I have tried all 4 MPLAB-IPE PK3 CLI listed under the Other available programmers section by moving them up under the programmers to use(in order), one at a time to see if any of those would work, but still getting this result.

    I am at a loss and of course I have one day left to make my pic16f1825 board work. In the interest of time, is there a place where I can download the last previous version of GCB that used the pusher, just to get this board out the door, or can anybody think of something to try with the latest version of GCB that might get me up and running? I am a bit desparate right now.

    I am also thinking that my pic18f23k22 board is still alright also at this point.

    Any help is greatly appreciated.

     
  • Anobium

    Anobium - 2018-06-28

    Probably not the programmer.

    Post the #config line of your code please.

     
  • Moto Geek

    Moto Geek - 2018-06-28

    Here are both of them.

    #chip 16F1825, 20
    #config OSC = HS, Pllen = OFF
    
    #chip 18F23k22, 20
    #config OSC = HS, Pllen = OFF
    

    they are both using an external crystal also.

     

    Last edit: Moto Geek 2018-06-28
    • Anobium

      Anobium - 2018-06-28

      Odd. The following does not compile.

      #chip 18F23k22, 20
      #config OSC = HS, Pllen = OFF
      

      This does compile.

          #chip 16F1825, 20
          #config OSC = HS, Pllen = OFF
      

      Dont worry about the 18F23k22 none compile.

      It could be the mclr is different, try

      #chip 16F1825, 20
      #config OSC = HS, Pllen = OFF, MCLRE=ON
      
       
  • Moto Geek

    Moto Geek - 2018-06-28

    Hi Evan, I changed the config line and added the MCLRE=ON, and I get the same behavior. While the pickit 3 is attached I can power cycle the board and it starts up perfectly every time. One thing I did notice is, when I remove power, in the IPE, it says target removed, then when I power up again it there is a very slight delay until the IPE says target voltage detected, target device PIC16F1825 found, Device ID Revision = 4, then the program starts running. This is a very short delay, just not right away like if the Pickit 3 were removed and power applied. But long story short, still won't run without pickit 3 attached.

     
  • Anobium

    Anobium - 2018-06-28

    I am sure this has been seen before - set the MCLRE=OFF and test.

    #chip 16F1825, 20
    #config OSC = HS, Pllen = OFF, MCLRE=OFF
    
     
  • Moto Geek

    Moto Geek - 2018-06-28

    Sorry, no dice. Same result. I just tried this on 2 more identical boards that worked before I reprogrammed them. They were programmed with the last version of GCB with pusher, now they too are acting the same way. The pickit has to be connected.

     
    • Anobium

      Anobium - 2018-06-28

      Pusher is simply MPLAB-IPE. So, use MPLAB-IPE to program the hex.

       
  • Moto Geek

    Moto Geek - 2018-06-28

    Just tried something else. With the pickit NOT connected, I powered up the board, and nothing. Then with power still connected I attached the Pickit and the board fired right up.

     
  • Moto Geek

    Moto Geek - 2018-06-28

    I will try that, stand by

     
  • Moto Geek

    Moto Geek - 2018-06-28

    Tried by just creating the hex, loading it and programming. Same result. Also tried same method with MCLRE=ON and MCLRE=OFF. Same result.

     
  • Moto Geek

    Moto Geek - 2018-06-28

    Evan, a discovery...

    Here are the first few lines of my program...

    #chip 16F1825, 20
    #config OSC = HS, Pllen = OFF, MCLRE=ON
    
    #define USART_BAUD_RATE 250000
    #define USART_TX_BLOCKING
    

    I started to rem out lines after the config, and when I got to the usart_tx_blocking and remmed it out, the board works perfectly without the pickit 3 attached. I tested it with two other boards and that one line seems to make the difference.

     
    • Anobium

      Anobium - 2018-06-28

      Upload your project as a ZIP. I need the source and the everything. I wonder what is happening.

       
  • Moto Geek

    Moto Geek - 2018-06-28

    Ok, I'll send to email

     
  • Paul Haug

    Paul Haug - 2018-06-28

    Although I am still a beginner at GCB, one thing I try is removing code a few lines at a time to see when the problem stays or goes away. At lest (for me) it narrows down where the problem lies.

     
  • Paul Haug

    Paul Haug - 2018-06-28

    Could you have possibly lost or removed the pullup on the /MCLR ? I know you said these boards were working befor, so just a shot in the dark from me..

     

    Last edit: Paul Haug 2018-06-28
  • Moto Geek

    Moto Geek - 2018-06-28

    @Paul, that exactly how I found the line that was bothering things, by remming one line at a time. Thank God it was quite early in the code. The wierd part about this was that it occured on two different chips 16f and 18f, but the code is basically the same (pun intended). Evan sent me something to try and I will this afternoon to see if that resolves things.

     

Log in to post a comment.