Program the flash memory of an 8051

157 views Asked by At

I am trying to program an AT89C51 through 12 volt parallel programming using Arduino, I have followed the instructions according to the data sheet. The program I'm trying to load is simply displaying the value of 10011011b on Port 1.

:0400000074ABF59058.
:00000001FF.

which would load the following into the program flash memory:

000 -- 74H
001 -- ABH
010 -- F5H
011 -- 90H

The following Figure shows the circuit I built.

Circuit Diagram

The algorithm I used is the following:

  1. Set the configuration bits:
    • P2.6 -- Low
    • P2.7 -- High
    • P3.6 -- High
    • P3.7 -- High
  2. ALE/PROG -- High
  3. EA/Vpp -- High
  4. Wait 48t_CLCL Min
  5. EA/Vpp --12V
  6. Delay 10 micro seconds
  7. Set the value of the addresses
  8. Wait 20 micro seconds
  9. Place the data value
  10. Wait 100 micro seconds
  11. ALE/PROG -- Low
  12. 60 micro second delay
  13. ALE/PROG -- High
  14. 20 micro second delay
  15. Data in Low
  16. 20 micro second delay
  17. Low Addresses
  18. EA/Vpp -- High

After this process, a negative pulse is expected through port P3.4 (RDY/BSY), but I do not get the pulse. I do not have an oscilloscope and it is not possible to appreciate the pulse, so I have connected P3.4 to a 7490, the states at the output of the chip do not vary, which indicates that the negative pulse is not generated by P3.4. Additionally, I am not executing the verification, I simply hope to obtain the value of 10011011b for P1, but I don't get what I expect. I request in the most restrained way your kind help trying to help me find the flaw in my illogic.-

1

There are 1 answers

0
Peter Plesník On

According to the schematic, you have incorrectly connected data and low addresses. P0 is for data read/write and P1 is for address input. Your diagram shows that the data is connected to P1 and the address is connected to P0. Also, the diagram shows that you have the upper 4 bits of P0 connected directly to ground. This is very unfortunate because it means that if P0 is set to output then the output drivers are shorted.

I also recommend buying some cheap logic analyzer (eg sigrok). Because in the event of a malfunction, we need a recording of the entire event and not only its verbal description.