Author Topic: PIC16F18857 programming with PICKIT2  (Read 2326 times)

0 Members and 1 Guest are viewing this topic.

Offline bequest333

  • Contributor
  • Posts: 16
  • Country: jp
PIC16F18857 programming with PICKIT2
« on: January 24, 2018, 03:30:13 pm »
Hi,

I was able to program PIC16F18857 with PICKIT2.
 1.It is necessary to create 14 new scripts.
 2.It is necessary to minimize-recompile "PICkit2_PCAppSource_V2_61".
 3.It is necessary to?describe Reverse lower 14-bit's deviceID in the Script. (ICSP MSB Fist Device only.)
18857's DeviceID:3074 -> 00.11.00.00.01.11.01.00 ->00.00.10.11.10.00.00.11 -> 0B83

Attach the changed host and device file.

<ICSP compatibility>
?Load PC Adress AAF2    BB01    AAE7    BB01    AAF2    BB80    AAF2    BB07    AAF2    BB00
F2 01    WRITE_BYTE_LITERAL    01    //0000.0001 -> 1000.0000    Load PC Address(80)
E7 01    DELAY_SHORT               01    //TDLY
F2 80    WRITE_BYTE_LITERAL    80    //1000.0000 -> 0000.0001    0x01                                                 //Adress U
F2 07    WRITE_BYTE_LITERAL    07    //0000.0111 -> 1110.0000    0xE0                                                 //Adress H
F2 00    WRITE_BYTE_LITERAL    00                                               0x00                                                 //Adress L

?Load for NVM AAF2    BB00    AAE7    BB01    AAF2    BB00    AAF1    AAF1
F2 00    WRITE_BYTE_LITERAL    00    //0000.0000 -> 0000.0000    Load for NVM(00)
E7 01    DELAY_SHORT               01    //TDLY
F2 00    WRITE_BYTE_LITERAL    00    //Data U   *Send "0"
F1       WRITE_BYTE_BUFFER              //Data L   *Replace H/L and LSB/MSB Sort inside the host after sending.
F1       WRITE_BYTE_BUFFER              //Data H   *

?Read from NVM AAF2    BB3F    AAE7    BB01    AAEF    AAF0    AAF0
F2 3F    WRITE_BYTE_LITERAL    3F    //0011.1111 -> 1111.1100    Read from NVM(FC)
E7 01    DELAY_SHORT               01    //TDLY
EF       READ_BYTE                            //Data U  *Receive only (Not use Buffer)
F0       READ_BYTE_BUFFER               //Data L  *Replace H/L and LSB/MSB Sort inside the host before receiving.
F0       READ_BYTE_BUFFER               //Data H  *

?Other commands
LAB <-> MSB only Sort
F2 18    WRITE_BYTE_LITERAL    18    //0001.1000 -> 0001.1000    Bulk Erase Memory(18)
F2 0F    WRITE_BYTE_LITERAL    0F    //0000.1111 -> 1111.0000    Raw Erase Memory(F0)
F2 1F    WRITE_BYTE_LITERAL    1F    //0001.1111 -> 1111.1000    Increment Address(F8)
F2 07    WRITE_BYTE_LITERAL    07    //0000.0111 -> 1110.0000    Begin Program(E0)

Referred to:
http://www.microchip.com/forums/m1011325.aspx

best regards,
Dan
« Last Edit: January 24, 2018, 03:35:19 pm by bequest333 »
 
The following users thanked this post: KL27x, lapi, jaka

Offline picandmix

  • Frequent Contributor
  • **
  • Posts: 395
  • Country: gb
Re: PIC16F18857 programming with PICKIT2
« Reply #1 on: January 24, 2018, 08:30:56 pm »
Normally all you have to do, is rename your existing PK2DeviceFile.dat in the Pk2 folder and then copy over the new Mypk2devicefile.dat file into the Pk2 folder and rename it PK2DeviceFile.dat

Thats it , as soon as you start V2.61 the new file is loaded, no need to reload anything.

If you intend to do lots more work with the newer Pics then getting a Pk3 ,genuine or a cheap clone,  means you have ready made access to all the new chips and future updates by Microchip, plus it allows you to Debug your program via Mplab, along with the other useful features like Usart tool etc.
« Last Edit: January 24, 2018, 08:33:43 pm by picandmix »
 

Offline pekka

  • Newbie
  • Posts: 1
  • Country: fi
Re: PIC16F18857 programming with PICKIT2
« Reply #2 on: April 22, 2019, 09:26:22 am »
Dear bequest333

I am very pleased to find your program to do PIC16F18857  with PICKIT2.
I do have PIKKIT3 also, but it needs all kinds software to program wit it.
I have prorammed PICs since 1995.

PICKIT2 is quite good device. 

I downloaded your software and put it same index with PICKIT2 program.
It was PICKIT2.61 version.

I renamed your datafile My_PK2DeviceFile.dat to  PK2DeviceFile.dat.
I started to program PIC16F18857.

It found the device!

Then I took my old program ( HEX file) and try to download the program.
It was done by a CCS/PCM vesion 5.07

It went right, but checking the program, it will show that eeprom was not right.

I read the PIC16F18857 and got that my eeprom was full of 0xC0.

Then I tried to program the PIC again with 0xC0's in the eeprom file.
It will give the configuration error?

Well your software is almost ready, but it will need some fine adjustment.

Can you check your fine program? 

My email is oh3gdo@gmail.com

Regards
Pekka Ritamaki
Finland
 
The following users thanked this post: KL27x

Offline jaka

  • Newbie
  • Posts: 3
  • Country: fi
Re: PIC16F18857 programming with PICKIT2
« Reply #3 on: June 04, 2021, 04:48:29 pm »
Hi all,

First, I apologize bringing up this old topic. But I must thank the OP bequest333 for the hard work to support SPI type PICs!

I used your modified source files, and developed them further. I added support for new PIC18 family with SPI type programming ( PIC18F MSB1st ). I also fixed the bit shifting of device ID, which is now read correctly. This means that it is possible to use the device file from PICKitPlus project.

I call the software PICkit2- or PICkit2minus. I attach the new software, modified source files and device file to this post. The device file is the last publicly available PKPlusdevice file 2.63.218, but I have fixed the K83 family which had incorrect configuration mask.

The PICkit2- is also available on my website at http://kair.us/projects/pickit2minus/index.html
If I make new versions in future, they will be released there.

[attach=2]
 
The following users thanked this post: Gyro

Offline bequest333

  • Contributor
  • Posts: 16
  • Country: jp
Re: PIC16F18857 programming with PICKIT2
« Reply #4 on: June 05, 2021, 05:19:54 pm »
Hi,jaka

Thank you for picking up my old topic.
First thanks.

I would like to thank you for making improvements related to ID that I could not do.
Second thanks.

Finally, thank you for publishing the improved source files.
Third thanks.

I feel that the world is connected from the thread of the Microchip Forum mentioned in the first thread.

Thank you very much.
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 1993
  • Country: us
Re: PIC16F18857 programming with PICKIT2
« Reply #5 on: June 06, 2021, 12:52:04 am »
Are you aware of the PICkit2 Device File Editor program.
I'll attach the executable (don't remember where I downloaded it from).
 

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 1007
  • Country: es
Re: PIC16F18857 programming with PICKIT2
« Reply #6 on: June 06, 2021, 10:59:35 pm »
This was a thing 10 years ago, when the pickit3 was still expensive (40-50euro).
I remember modding the pickit 2 database to add support for the PIC32MX795.
But it was slow and painful. When the clones appeared, I bought one at sure electronics for 25euro. And it still works today!
Nowadays you can get them for 10euro or less, so what's the sense on keeping the pickit 2 alive?
It costs close to the pickit 2 and you can't debug or program new devices using MPLAB X.
You are tied to use pickit 2 programmer forever  |O
« Last Edit: June 06, 2021, 11:03:43 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ
Stm32 Soldering FW      Forum      Github      Donate      I need calibration reports!
 

Offline nigelwright7557

  • Frequent Contributor
  • **
  • Posts: 397
  • Country: gb
    • Electronic controls
Re: PIC16F18857 programming with PICKIT2
« Reply #7 on: June 07, 2021, 02:47:36 am »

If you intend to do lots more work with the newer Pics then getting a Pk3 ,genuine or a cheap clone,  means you have ready made access to all the new chips and future updates by Microchip, plus it allows you to Debug your program via Mplab, along with the other useful features like Usart tool etc.

Be careful where you source your PK3. I got a Chinese copy and had all sorts of reliability problems.
I got one from Farnell and that one worked much better being an original Microchip version.
I have a Snap programmer for bigger chips as it is much faster than PK3 but cant supply power to the device.
 

Offline jaka

  • Newbie
  • Posts: 3
  • Country: fi
Re: PIC16F18857 programming with PICKIT2
« Reply #8 on: June 07, 2021, 03:39:16 pm »
My main motivation to update PICkit2 software for new devices is to provide easy and cheap way for people to program PICs used in my electronics projects. I agree that if you want to develop and debug your own code, you should be looking at something more modern.

I have used many different programmers/debuggers throughout the years. ICD2, PICkit2, PICkit3, ICD3, CCS ICD-U80, CCS ICD-U64, PICkit4, ICD4. The most reliable of these devices has been the PICkit2, it just works. For just programming the PIC, the easiest to use software is the PICkit2 (and 3) standalone software. These are only my opinions and experience.

Well, to be honest I haven't been using PICkit4 and ICD4 that much. I didn't run into problems with those, so they look promising. Except the software. The command line IPECMD is sooooo sloooooooow compared to earlier Microchip command line tools, which were tool-specific.

I forgot to thank PICKitPlus team ( https://www.pickitplus.co.uk/ ) in my first post, for their work on maintaining the device file. They have now decided to supply device file updates only for paying customers. I understand that, as it is tedious work.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf