Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Can't load new program to pic 16f877

Status
Not open for further replies.

AboudaKing

Member level 1
Joined
May 22, 2019
Messages
37
Helped
0
Reputation
0
Reaction score
1
Trophy points
8
Activity points
234
Trying to load a .Hex file into my microcontroller 16f877A
Using the k150 i can read the empty .hex file in my new pic but i can't upload my .hex file into it keeps on giving me error 'EEPROM ERROR'
but when i save the empty .hex in my pc then load it back into the pic it gets loaded with success any minor change get me back an error
I tryed other pic same reffrence but still same result
 

Hi,

There is the firmware hex --> flash
And there maybe is a data .hex --> eeprom.

From your post it sounds as if you want to load the firmware into the EEPROM. This won't work.

Klaus
 

Hi,

There is the firmware hex --> flash
And there maybe is a data .hex --> eeprom.

From your post it sounds as if you want to load the firmware into the EEPROM. This won't work.

Klaus
After compiling my assembly project i get only one .hex file wich is the data file as i know ,
My question is why the pic accept the empty file that it already have and get reprogramed with successfully, but any other file gives an error
Is there any step i have missed !?
 

How 'empty' is the empty file you refer to? If there is literally nothing in it then the programmer might just be doing nothing but saying it was successful at doing nothing.
If there is something in the 'empty' hex file then compare what it has with the new one of yours and see if you can see any key differences.
Susan
 

How 'empty' is the empty file you refer to?
I took screen shots
1: reading whats on the ic
1pic.PNG


2: the empty file i got all zeroes
2pic.PNG

3: loading same file after saving it on pc
6pic.PNG

7pic.PNG

And data get verified successfullly


Now trying to load one of my files or any other .hex file for pic 16f877A

3pic.PNG

4pic.PNG

5pic.PNG


And the eeprom error wich disapeared yesterday and got it back today
8pic.PNG
 

An empty ROM and EEPROM is one where all bits in all cells contain '1'. Given the PIC program memory is 14-bits wide you will see them as 3FFF as at the end of your program. I suspect you are not communicating with the K150 properly rather than a programming fault.

Brian.
 

I suspect you are not communicating with the K150 properly rather than a programming fault.
by saying not communicating properly, should I change the USB cable or does it mean my k150 is broken?
also what about my microcontroller is there a chance to be the reason for this ?
 

Before changing anything, a PIC with all '00' already has every bit programmed and you can't reverse the bits back to '1' by programming with new data, you have to erase the PIC first. The erase should make all addresses read back with all bits set so it should read 3FFF throughout the ROM.

Try erasing it, then reading it and tell us what you see.

If it contains 3FFF at every address, try loading your program in to it again.

Brian.
 

Try erasing it, then reading it and tell us what you see.
Screenshot_2022-05-08-22-18-34.png

I did erased the chip tho still have all zeroes
Also i tryed to read after removing the pic from programmer socket weirdly gaveall zeroes as well
So i took screenshots for this if it can help figuring out the problem
Screenshot_2022-05-08-22-19-06.png
Screenshot_2022-05-08-22-19-18.png
Screenshot_2022-05-08-22-19-30.png

--- Updated ---

Also after i erasing the chip when i 'erase check' it gives me this
4pic (1).PNG
 
Last edited:

CHIP ID should be 0E20 and it can be read whether it is programmed or not so your problem is either the K150 isn't taking to the computer or it isn't talking to the PIC.

There are several versions of K150, I've got three different ones here, can you show a photograph of it so I can see which version you have please.

Brian.
 

Hi,

Sounds if the target PIC is not powered properly.
Maybe a different fault.

Klaus
 

DVM = digital voltmeter

means:
* measure voltage
* not apply voltage

Klaus
 

One of mine is identical to that one.
They are not particularly good but they do work. The VPP voltage needed to program it comes from the 8-pin DIP IC which is an MC34063.

To program properly, the VDD to VSS voltage MUST be between 4.5and 5.5V and the VPP to VSS voltage MUST be 13V. Note that the 13V will only be present during the programming cycle and will switch off afterwards.

Brian.
 

Use a DVM directly at the power supply pins of the PIC.
between the power supply PIN's VSS/VDD it gives 5-5.1v
the VDD to VSS voltage MUST be between 4.5and 5.5V
it gives steady 5-5.1v with both supply pins group (11/12)-(31/32) also a 5v with (VDD/VSS) PIN's in ICSP mode
the VPP to VSS voltage MUST be 13V
but when it comes to VPP/VSS it's 6.1V not 13V as you have mentioned
though it is present only when reading or programming with the '0000' HEX file that I have mentioned
 

A DVM is OK for the steady voltages, but I would suggest that you use a scope to measure the VPP as it might well be popping up and down. 6.1V is way too low BUT it might be what the DVM sees as the average.
Susan
 

but I would suggest that you use a scope to measure the VPP as it might well be popping up and
unfortunately i don't have scope to do that all i have at this point is DVM

What about using the ICSP method instead of the built in socket
Would that make any diffrence ,maybe the socket is bad quality and not providing valid connections
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top