The programmer shown in this application note

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: The programmer shown in this application note operates in this mode. As an alternative, the target system can have its power supplied from the programmer through the same connector used for the communication. This would allow the target to be programmed without applying power to the target externally. Table 2. Recommendations when Designing Hardware Supporting In-System Programming Pin GND Allow the In-System Programmer to Reset the target system SCK When the target AVR microcontroller reset is active, this line should be controlled by the ISP Programmer. Edges on this line after Reset is pulled low will be critical, and cause the target AVR microcontroller to loose synchronization with the programmer. When programming, oscillations on this pin should be tolerated by the surrounding system when the AVR Reset is active MOSI When the target AVR microcontroller Reset is active, this line should be controlled by the ISP Programmer. When programming, oscillations on this pin should be tolerated by the surrounding system when the AVR Reset is active. MISO When the target AVR microcontroller Reset is active, this line should be allowed to become an output. When programming, oscillations on this pin should be tolerated by the surrounding system when the AVR Reset is active VCC 4 Connect ground of the target to ground of the In-System Programmer RESET Programming Protocol Recommendation Allow the In-System Programmer to draw power from the target system, to adapt to any allowed target voltage. The maximum current needed to power the programmer will vary depending on the programmer being used. Immediately after Reset goes active on the target AVR microcontroller, the chip is ready to enter Programming mode. The internal Serial Peripheral Interface (SPI) is activated, and is ready to accept instructions from the programmer. On the AT90S1200, it is very important to keep the AVR910 0943E–AVR–08/08 AVR910 SCK pin stable, as one single edge will cause the target to loose synchronization with the programmer. For other devices use the synchronization algorithm specified in the datasheet. After pulling Reset low, wait at least 20 ms before issuing the first command. Command Format All commands have a common format consisting of four bytes. The first byte contains the command code, selecting operation and target memory. The second and third byte contain the address of the selected memory area. The fourth byte contains the data, going in either direction. The data returned from the target is usually the data sent in the previous byte. Table 3 shows an example, where two consecutive commands are sent to the target. Notice how all bytes returned equal the bytes just received. Some commands return one byte from the target’s memory. This byte is always returned in the last byte (byte 4). Data is alwa‘ys sent on MOSI and MISO lines with most significant bit (MSB) first. For de...
View Full Document

Ask a homework question - tutors are online