Page 1 of 1

adding PIC16F1937 HELP!

PostPosted: 25, 2009 Oct Sun 8:54 am
by JeroenP
Hi,

For a college project I'm using the PIC16F1937. I'm trying to find some programming software that I can use to program this IC.
I have a Velleman programmer which seems to work with WxPic. The problem I'm facing now is to get the IC definition right.

I can erase and read the chip but programming the data leads to some errors. The data is programmed partially, some addresses stay empty.

I hope you, or anyone else reading this, is willing to create a definition for my PIC based on the datasheet. I don't have much experience with IC's and for some parameters I'm not sure what to put.

Looking forward to your answer! Thanks in advance...

Re: adding PIC16F1937 HELP!

PostPosted: 25, 2009 Oct Sun 9:55 am
by admin
Hi Jeroen,

If you indicate the addresses that fail to be programmed that may help to determine the actual issue.
Though I suppose you will have to read the programmer guide for this model of PIC to determine its specificities and to duplicate and adapt an existing PIC device data to create your own definition.
I will be happy to integrate the result in WxPic and add you in the contributor list. But I am spending a lot of time managing the WxPic code so I am afraid I won't have time to build the definition of all the requested PIC models.

Philippe

Re: adding PIC16F1937 HELP!

PostPosted: 25, 2009 Oct Sun 10:01 am
by JeroenP
Hi,

I understand completely. Can you suggest a model from which I should derive my own definition?
The 16F1937 has two config words. Which programming algo is the best to choose? I already tried a few.

Re: adding PIC16F1937 HELP!

PostPosted: 25, 2009 Oct Sun 10:54 am
by admin
You may try the PIC16F737. It has 2 config words and its ID differs only from 2 digits :!:
I have no more clue than that for this proposition.

Re: adding PIC16F1937 HELP!

PostPosted: 25, 2009 Oct Sun 1:17 pm
by JeroenP
Thanks for the idea. I have it working a littble bit.
With the definition below I succeeded to program the CODE memory of the chip. unfortunately I'm not able to program the Config memory and therefore I cannot program the config word. A simple blinking LED is now working with the default config word. But for my real application I need to change the config word.

I was also wondering if WxPic can 'see' my second config word?
The first word is at 0x8007 and the second word at 0x8008. When I hit the 'Program config word only' button it only tries to program the 0x8007 space. Possibly the definition needs some altering? I hope you can help me with this. I'm getting closer though!


Maybe can be of some help, link to the Memory Programming Specification for 16F19X chips; http://ww1.microchip.com/downloads/en/DeviceDoc/41360A.pdf



[PIC16F1937]
info1= PIC16F1937
info2= PIC16F1937
DeviceName=PIC16F1937
DeviceInfoFileName=PIC16F1937.dev
CodeMemType=1
CodeMemSize=8192
DataEEPROMSize=256
InternalRAMSize=512
AddrConfigMem=0x8000
AddrConfigWord=0x8007
AddrDataMem=0x1E000
AddrOscCalib=0xFFFFFFFF
ConfigMemUsedLocs00_1F=0x07CF
ConfigMemUsedLocs20_3F=0x0000
DeviceIdAddr=0x8006
DeviceIdMask=0x2380
DeviceIdValue=0x2382
CanRead=1
EraseAlgo=16F7x7
CodeProgAlgo=16F7x7
ConfigProgAlgo=16F7x7
DataProgAlgo=16F7x7
VppVddSequence=Vpp_before_Vdd
Ti_Clock_us=10
Ti_Prog_us=1000
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

Re: adding PIC16F1937 HELP!

PostPosted: 25, 2009 Oct Sun 3:09 pm
by admin
That's seems correct but I did not yet verify the programming algo for that device.
In the "Device, config" tab do you see all the expected flags? and do they correctly change when editing the second config word value. Or on the other direction, can you modify the config flags and see the config word #2 value updated?

Re: adding PIC16F1937 HELP!

PostPosted: 25, 2009 Oct Sun 3:22 pm
by admin
I found these errors (but this should not be fatal):
DeviceIdMask=0x3FE0
DeviceIdValue=0x2380

And I discovered that my version of the PIC16F1937.dev file from MPLAB id incomplete: Only 2 bit-group fields are defined for the second config word while there should be 7. This makes impossible to modify those bit using symbol but that should not prevent to program them if obtained by the HEX file or set in the Hexa config word value.