??? 09/20/04 16:20 Read: times |
#77724 - AT89S8252 ISP via SPI |
I'm having some trouble programming an AT89S8252 in-system using the Atmel serial programming approach documented in the Atmel datasheet. I'm using a PC parallel port to communicate via SPI.
Problem summary: It seems that the MISO line going from the AT89S8252 back to the PC isn't behaving as I'd expect it to. I'm using the SP89 PC software and pinout. My schematic is available here. Unfortunately I don't have a scope available which has complicated things. In an attempt to determine what's happening I wrote an assembly program that I loaded onto the AT89S8252 to monitor the P1 port pins and dump their status to the UART whenever they changed along with a time counter in 1/10,000's of a second. I moved the RESET line from the parallel port connection to P1.4 so I could monitor the behavior of RESET. Since SP89 is open-source I then modified it to slow it down by a factor of 100x so my program and, more specifically, the UART could keep uo with it. I then ran SP89 and verified that what it intends to send is being received by the MCU. However, I then modified my MCU program to toggle MISO every time SCK goes low. As a result I'd expect the SP89 program to receive something similar to 0xAA or 0x55 back from the MCU. Instead, it seems to consistently receive 0x85. All I can conclude is that for some reason the output on MISO is not being correctly received by the PC and that this is the source of my problems. Looking at my schematic can anyone see why the output of MISO would not be properly received by the PC's parallel port? Thanks, Craig Steiner |