Programmer for AT89LP series of 8051's

Started by mik3ca 5 years ago4 replieslatest reply 5 years ago872 views

I made an AT89S52 programmer as shown below to be used with the PC parallel port.


The nice part is that the thing works, however each time I want to initiate a new session I have to disconnect the circuit from the power and PC and short the power lines together then reconnect everything. Other than that it works. Resistors to SPI pins are 10K. the reset resistor is 100K. LED resistors are 220 ohm each. Crystal is 20Mhz and caps connected to it are 33pF. Decoupling capacitor is 100uF electrolytic. The buffer IC is actually 74HC125.

I recently ordered a large number of AT89LP4052's online due to their higher speed properties. I see they also have serial programming lines. I read the manual and it doesn't answer my questions. 

So I'm wondering. Do all atmel (microchip) microcontrollers that support SPI programming require an external crystal setup to be connected to their XTAL1 and XTAL2 pins respectively (just like how I wired up the crystal in my programmer)? or does something internal happen in the AT89LP4052 that makes the crystal unnecessary or disadvantageous?

If I switch the micro in the circuit above to the AT89LP4052, could I connect the same lines up and run another pin to my port to control the SS line? I'm sorry but the manual for this particular micro has me lost. I did program AT89C4051 and AT89S52 before but I'm struggling with AT89LP4052.

Oh an to clarify, the circuit does show the micro as the big IC, but in reality its just a large DIP socket that can hold the actual micro so that I can easily insert and remove it.

[ - ]
Reply by mirceacDecember 31, 2018

For the serial programming (also named In-System Programming (ISP) in the datasheet) you need to have a crystal connected, because this method is thought to be used AFTER manufacturing for firmware updates and such.

You can't use this method for new and unprogrammed devices because you need to first enable the ISP bit via parallel programming (see 22.5 In-System Programming (ISP): "The ISP Enable User Fuse must be enabled through Parallel Programming prior to entering the first ISP session. ISP itself may disable the ISP Fuse, however any changes to the ISP fuses will not take affect until the device has been powered down and up again."), that is a fast programming method thought to be used during manufacturing, so you have to change your programmer to use parallel mode for the new devices, where a crystal is totally not necessary as the XTAL pins are used for the programming operation.

[ - ]
Reply by MarkDSylvaDecember 31, 2018

Maybe my answer won't help you, but I am curious why you would spend the time on this programmer instead of buying a commercial one such as the $100 GQ-4X4 from mcumall. 

I don't see the device you are using on the supported device list, but they do support the AT89C4051 and it should be easy to edit the device file to support that part.

I'm asking this as I would think that is faster and cheaper, plus I haven't seen a parallel port on my PC's in at least 15 years! 

[ - ]
Reply by mik3caDecember 31, 2018

My computer has the parallel port and I even written software to send data through the parallel port to the programmer. I have access to a local shop that sells most electronic parts I need. What first inspired me to make my AT89C4051 programmer is this: http://www.oocities.org/dinceraydin/8051/index.html

[ - ]
Reply by JohnHPoteDecember 31, 2018

Or even the slightly cheaper TL866IIplus which seems to work OK.

What this OP does not seem to have grasped yet is that the devil can be in the data sheet (sometimes it's not even in the data sheet). Also there has to be some way of 'looking' into the system to see what's going on. For embedded systems like he's getting in to that has to mean an oscilloscope so timing and shape/format of waveforms can be seen. See https://www.embeddedrelated.com/thread/7335/why-mi...