atmel at89c51 programmer
Hi,
I wonder why you don't want to use an 8255, it's easy to program, flexible and inexpensive, but any way you must have your reasons.
The AT89C51 has 4Kb of flash, to address them you need 12 address bits. In addition you have the 8 bits for the data bus. Also there are the 4 control signals (P2.6, P2.7, P3.6 and P3.7). Also you have The ALE/-PROG signal and the -EA/VPP.
This brings the total to 26 inputs to the microcontroller. You can use four simple D type latches such as the 74373. Their data inputs should all be connected together to the 8 data lines of the parallel port (pins 2-9 on the DB-25 connector), their -CS (or -OE) input should be strapped to ground and each of their LE inputs should be connected to one of the remaining available outputs of the parallel port (namely Strobe (pin 1), AutoLinefeed (pin 14), Initialize (pin 16) and select printer (pin 17). The latches' outputs should be connected to the microcontroller.
Please note that some of these pins are hardware inverted, i.e. putting a 1 in the bit the controls the pin in the control register of the parallel port will give you a 0V output on this pin. If you are not fully familiar with the parallel port pinout and control registers, you can find very detailed information in this site:
www.BeyondLogic.Org
Now you can simply write the lower 8 bits of the address on the parallel port data lines and activate the LE of the latch connected to the lower 8 address lines of the microcontroller, then deactivate the LE input of the latch. Continue with the remainind data, address and control bits.
Please note that you have to study the programming timing carefully to be able to assign the signals to the latches, for example according to the timing diagram, the -EA/VPP should be issued at the same time with the address, so you will want to put this on the same latch as the higher 4 bit address lines, and so on.
Also note that this is a very simplisitc approach that doesn't provide you with any means to verify the data you wrote to the microcontroller. Again an 8255 would have provided you with this, but again you must have your reasons.
Finally, you can visit the application notes section of the Atmel web site (
www.atmel.com/dyn/products/app_notes.asp?family_id=604 )and see their application notes on 8051 family microcontrollers, they include programmer circuits using only TTL logic, although in my opinion more complex than this solution.
I hope I haven't bored you with unnecessary details, and I hope this would be of help to you, I know what you're going through as I am currently working on an AT89C52 programmer using the parallel port on a bread board, it's a hassle to say the least, the first thing I am going to do with it is to program an AT89C52 to operate as a serial AT89C52 programmer