Menu

changing from 16F1789 to 18f25k80

Help
2016-11-07
2016-12-27
<< < 1 2 (Page 2 of 2)
  • Anobium

    Anobium - 2016-12-19

    I do not know. I use PK3 gui will autoload, means, everytime i compile the pk3 gui does its funky stuff - I recommend this method if you do not have a serial bootloader.

     
  • Chuck Hellebuyck

    PICKit 3 has two operating systems floating around. One works with the GUI (like PICKit 2) with the autoload feature and the other is MPLAB X/IPE Compatible. Many of the PK3 clones on eBay use the GUI and any original Microchip PK3 uses the MPLAB X setup. Only the GUI has an option in the menu somewhere to reflash the operating system to either version. Both were created by Microchip but the GUI was put in archive and no longer supported. It lives on via third party the same way PICkit 2 does. PK3CMD requires the GUI operating system.

     

    Last edit: Chuck Hellebuyck 2016-12-20
  • Anobium

    Anobium - 2016-12-20

    Yes, Agree.

    We have included PK3 GUI within the build, so, you do not have hunt to find it. :-)

    If you install - you will find the Native Mode and the MPLAB X/IPE Compatible Mode firmware included.

     
  • Chuck Hellebuyck

    Did not realize that. Great. I use PK3 for MPLAB X work and PK2 with latest device file for GCB.

     
  • William Roth

    William Roth - 2016-12-20

    The PCK3 GUI installer is included with with the Latest GCB build. After installation, in the PK3 folder there will be a PK2Device file. Yes, the PK3 uses a PK2 device file. This device file will be be an older version that lacks support for many chips.. Rename this file to .bak, then copy the PK2devicefile.dat from the PK2 folder into the new PK3 folder. This will give the latest device support and correct some problems with the older PK2device files.

    There is a "GCB only" PK2Device file (150KB) that offers the best device support, but undersdand that PK2 is deprecated and many newer devices are not and never will be supported. And since the PK3 GUI relies upon PK2Device file it can be considered deprecated as well. But these can still be useful to those who are not ready or willing to update to IPE 3.45 or to use a bootloader.

    Using the PK3 GUI can be a pain, but it can be made to work automatically as Evan does. However there is a command line PK3CMD.exe available that works with the PK2Device file.dat. This file does not comes with the GUI install. You must get it from MPLAB 8.92. and has a file size of ~ 75KB. Do no confuse this PK2CMD.exe with the Java version that comes with MPLABX. (~44KB) as this file will not work with PK2 Device file. So temporarily install MPLAB 8.92. then find the included PK3CMD.exe and the associated readme/help files, and copy these to the PK3 GUI install folder or to the folder where the PK2DdeviceFile.dat resides..

    The PK3CMD.exe is then setup in the FlashPic.bat in a similar manner to PK2CMD. But ...some of the command line switches may be a bit different so read the instructions.

    =====================================================================

    Another option that does not require opening a GUI app is to use one of the IPE command line utiities that comes with MPLABX IPE. You must install the latest version (IPE 3.45) for best device support. These are what I use when not using a bootloader. Why? Because it offers the best device support. Here is the line I use in GCB FlashPic.bat for the IPE command line.

    "C:\Program Files\Microchip\MPLABX\v3.45\mplab_ipe\ipecmd.exe" -TPPK3 -P%2 -M -F%1 -OL

    To use the PK3CMD.exe that comes with MPLABX 3.45 IPE (44Kb Version)

    "C:\Program Files\Microchip\MPLABX\v3.45\mplab_ipe\PK3CMD.exe" -p%2 -M -F%1 -L

    ( The -OL and -L switches release the chip from reset. Otherwise If MCLRE = ON in the chip configuration the Program will not run until the PK3 is disconnected.

    ==============================================================
    Also I do not recommend using the PK3 to supply power to the PIC being programmed. It seems to have a signicicant voltage drop compared to PK2 and cannot supply adequate power in some cases.

    If you do try this either in the IPE GUI or with command line switches -V ( in PK3CMD.exe) or -W with IPECMD.exe the voltage must set to 4.5 or less, otherwise there will be an error generated and programming will fail. So these swithes would be -V4.5 or -W4.5. Example:

    "C:\Program Files\Microchip\MPLABX\v3.45\mplab_ipe\PK3CMD.exe" -p%2 -M -F%1 -L -V4.5
    

    William

     

    Last edit: William Roth 2016-12-21
  • Anobium

    Anobium - 2016-12-20

    Nice Bill. The only thing I would mention the '3.45' hardcoded in the batch file. When you upgrade you will need to change this string to the next version.

    I am going to have to ask... What is the difference between the GUI bewtween PK2 and PK3? It looks functionally the same for programming (not debugging).

     
  • William Roth

    William Roth - 2016-12-20

    These old GUI apps are functionally similar.

    The PK2 GUI allows setting OSCCAL on older chips and allows calibration of Vdd. The PK3 GUI does not.

    They both support the same devices as per the PK2DeviceFile.dat. So PK2 GUI is the superior choice between these two old deprecated apps.

     

    Last edit: William Roth 2016-12-20
  • David Stephenson

    I've investigated the problem more thoughly and it seems that it is not the different microchip programmes that is causing the problem. What appears to be happening is the unsucessful loads are using GPASM and the sucessful ones are using GCASM (I didn't know GCASM this was a thing).
    Question is where is this GCASM located so I can inculde it in my command line loads.
    I guess another question would be do I still need GPUTILS.

     
  • Anobium

    Anobium - 2016-12-23

    ? Puzzled.

    GPUTILS contains GPASM.

    Unless you have changes MAKEHEX.BAT ... GCASM is the default.

    The latest Help has the command line instructions and the use of the these two assemblees.

     
  • David Stephenson

    This is my DOS batch file

    echo
    cd\GCBASIC
    GCBASIC /NC %1 /O:compiled.asm
    C:\gputils\bin\gpasm -i -w2 compiled.asm >compiled.er1
    del compiled.cod >nul
    cd\Program Files (x86)\Microchip\MPLABX\v3.40\mplab_ipe
    pk3cmd (2) -P18f25k80 -V3.300 -Fc:\gcbasic\compiled.hex -m >c:\gcbasic\compiled.er2
    cd\GCBASIC
    notepad compiled.er2
    

    It used to be the recommendation to use GPASM and I've stuck with it, but my point is that it would seem that GPASM does not work for these newer fancier chips.

     
  • Anobium

    Anobium - 2016-12-27

    I would recommend trying the stock makehex.bat as your starting point.

     
  • David Stephenson

    I've got a BAT file that works with GCASM (not too taxing as it turned out).
    Question is is there any way I can pass the chip model number into the BATfile?

    echo
    cd\GCBASIC
    GCBASIC /NC %1 /O:compiled.asm /A:GCASM >compiled.er1
    del compiled.cod >nul
    cd\Program Files (x86)\Microchip\MPLABX\v3.40\mplab_ipe
    pk3cmd (2) -P18F25K80 -V3.300 -Fc:\gcbasic\compiled.hex -m >c:\gcbasic\compiled.er2
    cd\GCBASIC
    notepad compiled.er2
    

    That is replace the 18F25K80 with %CHIPMODEL% and it will pass the correct number based on what is in the ASM file (note the format of the input for PK3CMD there is no PIC in front of the chip number).
    The help files allude to some procedure, but it is not clear how to impliment it.

     
    • Anobium

      Anobium - 2016-12-27

      Please have a good look at MAKEHEX.BAT? And, the other stock batch files? Look at flashPIC.bat. These are the ones I would recommend you use as these probably support what you are trying to do.

       
<< < 1 2 (Page 2 of 2)

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.