Microcontrollers in Practice

The internal flash and EEPROM memory of many of the AVR microcontrollers can be programmed "in system", without removing the circuit from its socket, through the ISP (In-System Programming) interface. At the hardware level, the ISP interface uses the SPI lines MOSI, MISO and SCK to transfer data between the host and the device to be programmed. The ISP interface takes control of the SPI lines when the RESET input of the MCU is LOW.
Atmel Corporation offers a free software utility, called AVRISP, which allows the use of a personal computer to program the AVR microcontrollers through the ISP. Although the data transfer through the ISP is serial, the ISP interface is connected to the parallel port of the PC by means of a cable adapter. One possible implementation of the ISP cable adapter for the parallel port is presented in Fig. A9.1.
Figure A9.2 shows the layout of the PCB for this circuit. Note that the circuit is powered through the ISP cable.
For the ISP to operate, the MCU must be powered, and an external crystal must be present, for the oscillator. The XTAL frequency must be at least twice the frequency of the data transmission clock SCK.
The ISP protocol requires that 4-byte data packets be transferred through on the interface for...