Help: PIC programming?

Candle Power Forums

Help Support Candle Power:

LED_ASAP

Enlightened
Joined
Dec 13, 2002
Messages
567
City & State/Province
British Columbia, Canada
I bought a CPF logger lite kit quite a while ago. When I finally got around and assembled the kit, I found out the PIC in the kit was not programmed /ubbthreads/images/graemlins/icon3.gif I have never done a PIC programming before. After a long reading on the internet and several nights in my work shop, I built my very first PIC programmer--- Feng's RCD Programmer. I connected the cable and launched WinPIC.

Things didn't look too bad at first---the red LED lit up and WinPIC recognized the chip as 12F675. But all the good signs ended up there---the data were all 3FFF's, including the very last OSCAL value /ubbthreads/images/graemlins/confused.gif

I tried to load and burn the cpf-logger-lite-pic.hex file but didn't succeed. Here is the message I got:

Loaded translation file "C:\PROGRAM FILES\PIC\WINPIC\translation_french.txt" .
Info: Loading definitions for "PIC12F675" from devices.ini .
Info: 12F675 ProgSpec does not mention a DEVICE ID at 0x2006 ?!
Initialising PIC-Programmer: Success.
Testing: delay(500ms) took 0.49 seconds, timer_freq=1.1932 MHz ... ok
Results from LoadHex: LastProgAdr=0x02E2 LastDataAdr=0x2170
PIC- SelectVddNorm failed
Applied edits in CODE-MEMORY-dump.
Programming...
Erasing ("bulk" or "chip") ...
Erase: Read osccal, result 0x3FFF
Oscillator calibration word looks bad (0x3FFF) !
Erase: Read cfg with bandgap ref, result 0x3FFF
Erasing chip using algorithm "12Fxx" .
Programming CODE
Warning: using default OSC CALIB word instead of 0x0C80 .
Programming 0x0000..0x03FF, algo="12Fxx", CanRead=0 .
Verifying 0x0000..0x03FF
Verify Error: 0000: read 3FFF, wanted 3000
Verify Error: 0001: read 3FFF, wanted 008A
Verify Error: 0002: read 3FFF, wanted 283C
Verify Error: 0003: read 3FFF, wanted 0000
More Verify Errors, unable to list all (total=740)
Programming DATA EEPROM
Programming 0x2100..0x2170, algo="DATA_EEPROM_16xxx", CanRead=0 .
Verifying 0x2100..0x2170
Verify Error: 2100: read 3FFF, wanted 0000
Verify Error: 2101: read 3FFF, wanted 0000
Verify Error: 2110: read 3FFF, wanted 0043
Verify Error: 2111: read 3FFF, wanted 0050
More Verify Errors, unable to list all (total=83)
Programming CONFIG-MEMORY
Programming 0x2000..0x2003, algo="CONFIG_MEM_16xxx", CanRead=0 .
Verifying 0x2000..0x2003
Programming CONFIG-WORD
Config word = 0x3984; Config mask = 0x31FF
Programming 0x2007..0x2007, algo="CONFIG_MEM_16xxx", CanRead=0 .
Verifying 0x2007..0x2007
Verify Error: 2007: read 3FFF, wanted 3984
ERROR: Programming FAILED !
Oscillator calibration word looks bad (0x3FFF) !
Reading PIC FAILED (maybe blank).


Could someone with more PIC programming experience give me some hint on what's going on and how to fix it?

Will I distory the PIC if something I have done is wrong?
 
I can GUESS, dont know nothing about it, but guessing is always fun.

its broke :-)
the error log says that the voltage to something is wrong.

(edited, moved up in priority and ease of checking)
is the pic socketed, or soldered? it could have lifted in shipping if its socketed.
is the eprom socketed? are any pins bent? is it inserted correctally?

and because your getting THAT far, i would look for a problem with the connection on the corners of the eprom itself, cause they usually use the top right corner for power.
or one of the other chips if the eprom doesnt got no voltage going to it.

like trace the traces of the + power, to each of the chip thingees, and see if something is not soldered, or jumpered with solder, or if any parts in that path are lifted, or darkened.
If you got the warrenty ruined, and have it opened up, look or scan with a scanner (to get a close pic) the bottom of the eprom connections.

its like you have a Ram problem, well actually a rom problem, same difference.

pictures always help, mabey sombody will see a whole part you got they dont have :-)
 
First thing that you should do is 'read' the PIC in order to load its default 'settings'(OSCAL value, etc.). Try 'reading ' the PIC and check if the OSCAL, etc. is still there. After reading the PIC, you're free to program/re-program it.

What 'interface' did you choose in winpic? You can use the 'JDM programmer' interface but it's better to use the 'RCD interface'. RCD can be selected by choosing 'custom, on com port...', clicking on 'select' and loading the 'rcd_programer.ini'.

When using the RCD interface, the LED only lights up during PIC operations(eg. read, write, etc.).
 
The RCD programmer was my 1st one too and it works like a charm with the 12f675 or 12f683. I had problems too with the latest version of winpic, it seems configuration changed from the 1st one I used.

You can download my working winpic version from here (link will be removed in the future)

As legtu said, check the configuration, and before attempting to write, first read the OSCAL value from the PIC or you will lose it forever.

There is a security check for this in the options tab, if you uncheck it the OSCAL is at risk, but if its checked the program will do its best to protect it from your bad choices /ubbthreads/images/graemlins/smile.gif

Hope it helps


Pablo
 
Could cgpeanut forgot to program that PIC? It is hard to imagine knowing his character to check before he ships anything.

The PIC appears to be blank, either actually not programmed or erased blank. 12F675 is 14 bit cpu and each address you read is 00111111-11111111 which makes 0x3fff.

Though hardly believeable, the PIC may be defective or damaged. A PIC can be easily damaged by negative voltage or too high voltage supplied to the Vcc. It can even be damaged by prolonged heat from a soldering iron.

If you have problem of flashing the PIC, I will be glad to send you one preprogrammed PIC to you.

BTW, OSCAL value in 0x03ff address to be 0x34?? is important. When the PIC is powered up, the program executes "call 0x03ff" and the 0x34?? is opcode for "retlw ??" where ?? is the factory OSCAL value and the returned value is used to adjust the cpu speed. If it is erased as "0x3fff", the "call 0x03ff" statement will fail and will not return. This will hang the system.

From your quote, the program you use seems to read this value and restore back during the programming. But usually I read it first and write down at the bottom of the PIC in case I wipe it out accidentally.

-- dj
 
The PIC was connected via a socket and I am pretty sure it didn't get zapped by static discharge. One instance I might have killed it would be when I first powered up the logger without knowing that the 7805 was marked backwards on the PCB. The full 7V or so from COM1 was applied to VCC for about 10 sec when I took the reading---then I quickly pulled the connector off. I was hoping that the PIC survived since I didn't feel any heat or smell any thing, and the RCD Programmer still recognized the chip.

The learning curve is a little more steep than I thought it would be /ubbthreads/images/graemlins/smile.gif
 
Back
Top