0
\$\begingroup\$

When I programmed the AT89Cx051 series of microcontrollers, I didn't have to use special memory to program the data, but now even though I'm following the instructions in the datasheet (found from http://futurlec.com/Atmel/AT89LP4052-20PU.shtml) to the best of my ability, I still can't get the damn chip to run even when running it with a 555 timer at low speed as a clock.

But the new chip manual states theres a "load code page buffer" function and a "write code page" function. After (attempting to) erase the chip using the proper commands, I went straight to the "write code page" function and inserted the binary of the following code:

mov P1,#0A5h
sjmp $

When the chip runs correctly, the outputs of alternating port pins from P1 (starting with the lowest) should be logic high and the rest should be logic low, yet all I get is everything as logic high.

This is how I attempted to program 6 bytes in detail after erasure:

Make VPP 12V
set CS to low
Set P1 to AAh
Set XTAL to high then to low
Set P1 to 50h
Set XTAL to high then to low
Set P1 to 0h because high address is 0.
Set XTAL to high then to low
Set P1 to 0h because low address is 0. we start from byte 1.
Set XTAL to high then to low
Set P1 to 75h (the MOV instruction)
Set XTAL to high then to low
Set P1 to 90h (the P1 address)
Set XTAL to high then to low
Set P1 to 0A5h (the value)
Set XTAL to high then to low
Set P1 to 080h (for sjmp)
Set XTAL to high then to low
Set P1 to 0FEh (to stall)
Set XTAL to high then to low
Set P1 to 0h (padding)
set CS to high
wait for busy to reset

I think I'm doing everything right? but is it mandatory to execute the load code page buffer before writing the buffer? I'm confused.

The microcontroller in question here that I have difficulty with is AT89LP4052

\$\endgroup\$
1
\$\begingroup\$

You need to read the entire programming specification (section 23) in the datasheet. In particular, I call your attention to

23.4.3 Program Enable Function:

  • Enables the programming interface to receive commands.
  • Program Enable must be the first command issued in any programming session. In parallel programming a session is active while RST remains at VPP. In serial programming a session is active while RST remains at VCC.
\$\endgroup\$
  • \$\begingroup\$ I have done that as the first command before anything else, and I still am not getting results. I'm going to try the serial method. \$\endgroup\$ – Mike Oct 27 '18 at 23:12
  • \$\begingroup\$ Have you tried reading the data back out? \$\endgroup\$ – Dave Tweed Oct 28 '18 at 2:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.