PDA

View Full Version : difference in 'read all' and 'program all'



cheezy1963
- 20th November 2007, 03:09
New to PIC (1st project) so sorry if this is a stupid question and I'm overlooking the easy answer.

pic16f88
winpic800 v3.61

When I write (program all) a hex file which has a size of 2762 bytes to the PIC everything seems to work fine. No errors and the program runs correctly.

Then I (read all) and save the data as a hex file which has a size of 2851 bytes. Why the size difference? I don't see any errors during read or write. When comparing the file written and the file read it looks like only the last 4 lines are different but yet everything seems to work fine.

mister_e
- 20th November 2007, 03:20
paste those lines here... for the original and the read one.

cheezy1963
- 20th November 2007, 03:26
I compared the files again and the only differences are in the last 4 lines.

Here are the last 4 lines of the written file:
:0C03D0000D300C1EE92999006029630023
:04400E00622FFF3FDF
:00000001FF
;PIC16F88

And here are the last 4 lines of what comes back from the read:
:1003D0000D300C1EE929990060296300FF3FFF3FA3
:08400000FF3FFF3FFF3FFF3FC0
:04400E00622FFF3FDF
:00000001FF

mister_e
- 20th November 2007, 03:55
probably some unused/modified EEPROM data. Try to erase your PIC (ALL, code, eeprom etc), then reprogram it.

Could be some device id or something like that.

Did you set your configuration fuse in your code or with your winpic software?

cheezy1963
- 20th November 2007, 04:51
I tried the full erase and it didn't change anything.

The config fuse is in the code and I didn't change it in the software. I did another test to where I simply opened the original hex file and did a save as. The original was 2762 bytes and the new file was 2851 bytes. I'm thinking it is something with the software now. I'm going to play around with the settings and see if I can figure out what is causing it.

mister_e
- 20th November 2007, 15:01
i wouldn't bother too much with that... it could be something like a PIC revision or something like that, which is simply not set in the code, but a Microchip setting... which is way not useful unless you have a silicone issue.

Darrel Taylor
- 20th November 2007, 18:43
This line, <strike>I can't totally explain</strike>. It reads 2 (BLANK) program words, as if it's part of the program. :confused:

:0C03D0000D300C1EE92999006029630023
:1003D0000D300C1EE929990060296300FF3FFF3FA3

Added: AhHa, the 16F88 Flash is grouped in blocks of 4. The extra 2 words fill in the last block.<hr>
The next line is only in the (Read) version, and is the ID Locations.
They weren't specified in the original hex.

:08400000FF3FFF3FFF3FFF3FC0<hr>
This line is the Config Words (same in both)
:04400E00622FFF3FDF

DT



I compared the files again and the only differences are in the last 4 lines.

Here are the last 4 lines of the written file:
:0C03D0000D300C1EE92999006029630023
:04400E00622FFF3FDF
:00000001FF
;PIC16F88

And here are the last 4 lines of what comes back from the read:
:1003D0000D300C1EE929990060296300FF3FFF3FA3
:08400000FF3FFF3FFF3FFF3FC0
:04400E00622FFF3FDF
:00000001FF

cheezy1963
- 21st November 2007, 02:48
thanks guys. I appreciate the help. I normally wouldn't bother but I'm trying to learn this stuff and it always makes me wonder when I can't figure something out....even if it doesn't seem to be a problem. On top of that, I'm trying to make sure this simple programmer that I built is actually working the way it is suppose to. I thought a simple write/read would do the trick but that lead me to where I'm at :)

After my last post I went through winpic800 and played with the options and watched what it did to the output file. I noticed where the 'id' started to come into play as it was not in the original hex. I still wasn't able to figure out the difference in the first lines:

:0C03D0000D300C1EE92999006029630023
:1003D0000D300C1EE929990060296300FF3FFF3FA3

Even after reading Darrel's response I'm still a bit puzzled with these 2. The other lines make sense. Maybe you could explain a little more Darrel?

Here is a link to the actual circuit/application that I'm trying to duplicate.

http://njhurst.com/electronics/watersensor/new/

Maybe this may explain things a little more and you can help me understand.

Darrel Taylor
- 21st November 2007, 03:18
Well, it's like mister_e said ...
"i wouldn't bother too much with that..."

The minor differences between writing and reading will not interfere with the project you are building.

And IF everything else is correct????? That's a BIG IF.
It should work!
<br>

mister_e
- 21st November 2007, 03:35
Here we say... If it's not broken.. don't fix it :D

cheezy1963
- 21st November 2007, 04:22
Yes, you two are right.....I need to just let go and move on. I'm sure I will run into something else that will actually be a problem. Anyways, I've built the circuit and loaded the hex file and I'm getting good data back so I guess all is well. thanks again for your help.