Problem with adding PIC16F1827

Problems or tips related to the use of WxPic

Problem with adding PIC16F1827

Postby rsinisa » 29, 2012 Jul Sun 8:59 pm

I'm trying to add PIC16F1827, I copied definition from 16F1933 and made some modifications. It works almost perfect - only there is problem with configuration words (2 words). This is message from:

22:57:24.420 Programming...
22:57:24.422 Erasing ("bulk" or "chip") ...
22:57:24.908 Programming and Verifying CODE, 0x000000..0x000456
22:57:50.994 Programming DATA, 0x00F000..0x00F056
22:57:54.74 Programming CONFIG, 0x008000..0x008008
22:57:54.440 Verify Error: 008007: read 003FFF, wanted 000999
22:57:54.473 Verify Error: 008008: read 003FFF, wanted 001CFC
22:57:54.680 ERROR: Programming FAILED !

and this is my definition for this PIC:

[PIC16F1827]
info1= PIC16F1827
info2= PIC16F1827
DeviceName=PIC16F1827
DeviceInfoFileName=PIC16F1827.dev
CodeMemType=1
CodeMemSize=4096
DataEEPROMSize=256
InternalRAMSize=384
AddrConfigMem=0x8000
AddrConfigWord=0x8007
AddrDataMem=0xF000
AddrOscCalib=0xFFFFFFFF
ConfigMemUsedLocs00_1F=0x01CF
ConfigMemUsedLocs20_3F=0x0000
DeviceIdAddr=0x8006
DeviceIdMask=0x3FE0
DeviceIdValue=0x2420
CanRead=1
EraseAlgo=ERASE_16F62xA
CodeProgAlgo=16Fxx
CodeMemWriteLatchSize=8
ConfigProgAlgo=16Fxx
DataProgAlgo=16Fxx
VppVddSequence=Vpp_before_Vdd
Ti_Clock_us=10
Ti_Prog_us=10000
Ti_Erase_us=30000
CmdLoadConfig=0x00
CmdLoadProg=0x02
CmdReadProg=0x04
CmdIncrAddr=0x06
CmdBeginProg=0x18
CmdEndProg=0x0A
CmdLoadData=0x03
CmdReadData=0x05
CmdEraseProg=0x09
CmdEraseData=0x0B
CmdEraseChip=-1
CmdBeginProgNoErase=-1

Can anybody help me with this problem?

Best regards from Serbia.
rsinisa
 
Posts: 7
Joined: 29, 2012 Jul Sun 8:43 pm

Re: Problem with adding PIC16F1827

Postby admin » 31, 2012 Jul Tue 6:50 pm

Hello,

You are unlucky: I discovered your message Sunday evening just before going to bed. So I planned to read it Monday. But the website hosting was out of order yesterday evening. So I am just starting to analyze your problem. At fisrt glance it seems that the configuration algorithm does not do its job with this PIC model. I will compare the algorithm and the device spec to see what could be the issue...

Philippe
admin
Site Admin
 
Posts: 153
Joined: 12, 2009 Jul Sun 7:20 pm

Re: Problem with adding PIC16F1827

Postby rsinisa » 31, 2012 Jul Tue 7:48 pm

Well, I'm not in a hurry, but i will be thankful if You can solve this problem. Thank You in advance.

Best regards.
Sinisha
rsinisa
 
Posts: 7
Joined: 29, 2012 Jul Sun 8:43 pm

Re: Problem with adding PIC16F1827

Postby admin » 31, 2012 Jul Tue 9:46 pm

Sinisha,

I was puzzled because I have reviewed all the programming algo and all seemed OK. And finally I discovered a damned little sentence in the PIC16F/LF182X/PIC12F/LF1822 Memory Programming Specification at end of chapter 4.3.9 BEGIN EXTERNALLY TIMED PROGRAMMING :
The Begin Externally Timed Programming command cannot be used for programming the Configuration Words
I believe this explains exactly what has happened.
Microchip likes to play with our nerves by adding hidden specificities in every new family of chip.

Now you can try to replace the externally-timed programming command by the internally-timed one:
Code: Select all
CmdBeginProg=0x08

And optionally you can speed up programing by setting:
Code: Select all
Ti_Prog_us=5000

I hope there is no other hidden sentence somewhere that says you must not use the internal-timed programing for some specific case...
Please tell me what is the result of these changes and, if it works, please post the updated and tested working configuration so I can merge it in the device definition file.

Regards,
Philippe
admin
Site Admin
 
Posts: 153
Joined: 12, 2009 Jul Sun 7:20 pm

Re: Problem with adding PIC16F1827

Postby rsinisa » 31, 2012 Jul Tue 10:17 pm

Hey, it works!!! Thank You very much, You just made me very very happy because it is, for now as I now, only serial programmer who can programm this PIC under LINUX. And maybe under WINDOWS too, but I'm not sure for 100%. Great software!

Best regards from Serbia.
Sinisha
rsinisa
 
Posts: 7
Joined: 29, 2012 Jul Sun 8:43 pm

Re: Problem with adding PIC16F1827

Postby rsinisa » 31, 2012 Jul Tue 10:27 pm

I almost forgot. This is working configuration for PIC16F1827, I used JDM based programmer called "ALLPIC" which is very popular here because it can deliver Vpp before Vdd with little trick, made by my good friend.
And I have some bug to report (or feature?), in other appropriate forum discussion.


[PIC16F1827]
info1= PIC16F1827
info2= PIC16F1827
DeviceName=PIC16F1827
DeviceInfoFileName=PIC16F1827.dev
CodeMemType=1
CodeMemSize=4096
DataEEPROMSize=256
InternalRAMSize=384
AddrConfigMem=0x8000
AddrConfigWord=0x8007
AddrDataMem=0xF000
AddrOscCalib=0xFFFFFFFF
ConfigMemUsedLocs00_1F=0x01CF
ConfigMemUsedLocs20_3F=0x0000
DeviceIdAddr=0x8006
DeviceIdMask=0x3FE0
DeviceIdValue=0x2420
CanRead=1
EraseAlgo=ERASE_16F62xA
CodeProgAlgo=16Fxx
CodeMemWriteLatchSize=8
ConfigProgAlgo=16Fxx
DataProgAlgo=16Fxx
VppVddSequence=Vpp_before_Vdd
Ti_Clock_us=10
Ti_Prog_us=5000
Ti_Erase_us=30000
CmdLoadConfig=0x00
CmdLoadProg=0x02
CmdReadProg=0x04
CmdIncrAddr=0x06
CmdBeginProg=0x08
CmdEndProg=0x0A
CmdLoadData=0x03
CmdReadData=0x05
CmdEraseProg=0x09
CmdEraseData=0x0B
CmdEraseChip=-1
CmdBeginProgNoErase=-1

And this should be working for other similiar PICs, like 16F1826 etc.
Best regards.
Sinisha
rsinisa
 
Posts: 7
Joined: 29, 2012 Jul Sun 8:43 pm

Re: Problem with adding PIC16F1827

Postby admin » 06, 2012 Aug Mon 6:25 pm

I am pleased that this solves your problem.

Thank you for the configuration. I will multiply it for all the models defined in the same spec.

Regards,
Philippe

PS: Sorry for this late answer. The web site hosting has been down for almost all the week. :cry:
admin
Site Admin
 
Posts: 153
Joined: 12, 2009 Jul Sun 7:20 pm

Re: Problem with adding PIC16F1827

Postby admin » 15, 2012 Aug Wed 5:53 pm

Hi Sinisha,

I have released the V1.3.1 that includes your definition of PIC16F1827 and its family, as well as the bug fix for recent files. I made a change in your PIC16F1827 definition because the ID does not match the documentation. I believe you will have an error indicated in the Config Memory panel if you read your PIC ID. Anyway it's just informational.

Regards,
Philippe
admin
Site Admin
 
Posts: 153
Joined: 12, 2009 Jul Sun 7:20 pm


Return to WxPic Usage

cron