The usual - someone who can't make a pic run

Hi - I have what I thought would be a simple problem, but it’s taxing my capabilities a lot…

I want to write a simple hex program to a pic 12F675. The code is here - giantcod.co.uk/forum/viewtop … =15&t=3050
and you can see that there is some configuration data given as well.

I am using an 8048 board which has written pics before. I put the hex into a file, write it to the chip, and find that I can write the code to the pic, but can’t set the configuration data as specified on the web site. Unsurprisingly, the program will not run.

I have confirmed that I can run another program on the pic by copying a test hex ‘flashing led’ program to it, and I can make leds flash on the board, but when I try to write the program from the giantcod site I always fail with a configuration key error.

Giantcod confirm that their hex program is ok (as a test with just power on 1 & 8 it should flash pin 7 up & down 4 times), but I cannot get my 8048/pic12F675 to run it. I have tried picprog2, winpic and picprog2009 so far without success, and am running out of options.

If someone else has an 8048 and a 12F675 handy it would be really helpful if they could see if they could copy the hex and configuration data onto a pic successfully. I suspect that I have lost my oscillator calibration during this process, and wonder if that has anything to do with my failure…

Did you also test it with our PICprog2009 software, this can read INHX8x and INHX32, so it give a better compatibility than the old ProgPIC software.

Thanks for the response! I am grateful to know that someone has looked at the issue. I’m quite stuck - it’s only a dozen lines or so of code, but I can’t get it to go into the pic properly.

As I said above, “I have tried picprog2, winpic and picprog2009 so far without success”. So, yes, I have tried picprog2009. Each of these lets me write the hex to the pic, but won’t set the config bits properly. So each time I have a coded pic that won’t run.

Life is made more difficult by the fact that the configuration bits are specified differently in each of your programmers. in PicProg2 you have the opportunity to set a word, but this is not available in PicProg2009. The original code author specifies the config as:

“WDT must be enabled. Brown-out detect is ON. PWRTE is ON. Clock is INTRC_OSC_NOCLKOUT. MCLRE is OFF & CPD is OFF”

and says “The config word should be “1F4C”.”

INTRC_OSC_NOCLKOUT is not a specified choice for any of your programs, so I’m not sure which it is, and each time I set 1F4C manually each programmer writes a different config code to this…

A short update! I hammered this a bit over the weekend, using PicProg2009 - this writes the hex perfectly, either with or without the first line. But the only Config options it allows are:

Osc
Code protect
EE code protect
Brown Out Data
Pin Function (mclr)
Power-up Timer
Watchdog Timer

When I load the hex:

:020000040000FA
:100000008316FF2390009F018113273095001C3039
:100010008500831207309900850144204420442044
:100020004420A201A00164003F20051D2C28851951
:10003000A001A00B1328051A1B280514A20A6400AE
:100040003F20051D2C28051AA001A00B1F2885198B
:1000500027280510A20A13282208A000A00AA00B36
:1000600032281328051047204720472047204420E6
:10007000A00B37284720472047204720132842302D
:10008000A100A10B41280800051447200510A30179
:10009000A4016400A30B4928A40B49280034203490
:1000A00028346334293420345034683469346C344F
:1000B000203447347234653465346E34203432343D
:0800C0003034303439342034AF
:02400E004C3F25
:00000001FF

the settings become

osc - 100(intrc i/o Osc)
code protect - on
ee code - off
Brown-out - on
Pin Function - off
Power-up - on
Watchdog - off

I have to unset the code protection bit - this equates to a config word 31CC - and with this the pic will not run. I am able to cycle the osc value to try 31CD, 31CE and 31CF, but none of these run either. The code is meant to have a config word of 1F4C, but I can’t see how to make that happen with PicProg2009…

Do you have the source code from your “project” ?
PIC options are mostly set in soure code, not in the programmer.
We know MPLAB generated files are compatible but’s not guarantee for other compilers.

Kind of you to respond!

I am trying to build this project - giantcod.co.uk/forum/viewtop … =15&t=3050

The author of the project has only given the hex - you can see that it is very short, and there is some configuration data given as well. I had asked the author if the hex was MPLab compatible, and he said it was, so I had assumed that it would be simple to write the hex using my 8048.

I can write the hex to the pic using PicProg2009 as you advised, but the pic then does not work, and the config word does not seem to be 1F4C, as it ought to be. Once written, the pic can be tested by applying power to pins 1 and 8, and then pin 7 should give 4 flashes. But when I write it, the config word is 31CC and the pic does not flash…

What I had hoped was that someone else could try writing this hex to a 12F675 with a 8048, and see if they could get the config word 1F4C. If they can, then there is a problem somewhere with me. If they can’t, then there may be a compatibility problem with this hex and the 8048…

Whoops, sorry - the url given above is corrupted - it should read giantcod.co.uk/forum/viewtop … =15&t=3050

I did some tests, I send you an email with the result.
I doesn’t see any problem with the hex for programming this PIC.

[quote=“VEL456”]I did some tests, I send you an email with the result.
I doesn’t see any problem with the hex for programming this PIC.[/quote]

Thanks very much! That was what I needed to know.

I have been able to write the hex to the pic in just the same way as you have. But what I then found was that the pic did not flash 4 times on pin 7 as it was supposed to when power was applied to pins 1 and 8.

If you can write the hex to the pic and get 3F4C, then that shows that I can match your writing, and there is probably no problem with my 8048 board or PicProg2009. So there must be something else I am getting wrong, and I can chase that with the author of the program.

Thanks again…