89S/AVR(90S) Socket Stealer Document Version 1.0 Atmel 89S/AVR(90S) Socket Stealer Features • • • • • • • • • • • • • • • Adds In-System Programmability to existing 8051 and AVR circuits without target system re-design Removes the problems with implementing and debugging ISP Complete ISP solution in one. The Socket Stealer incorporates all the necessary ISP hardware, a suitable microcontroller, suitable reset circuit, ISP programmer connector and crystal The ISP programmer plugs into the Socket Stealer All I/O required for programming is isolated from the rest of the circuit when required thus avoiding driver contention During firmware execution all I/O is available. No I/O is lost to In-System Programming Can be left in the socket even when a programmer is not connected making field code updates possible Allows fast code development. Simply apply power and then continuously re-program the microcontroller Allows easier conversion of an existing 8051 circuit to an AVR design. No need to redesign the reset circuit or change the crystal Crystal socket allows changing of crystal frequency with ease Highly configurable. Six links provided to set various aspects of the Socket Stealer allowing a degree of customisation for different circuits Plugs into a 40-pin DIL socket or 44-pin PLCC socket previously occupied by the original microcontroller Available with a 40-pin to 20-pin adaptor allowing a Socket Stealer to replace an Atmel 89C1051/2051/4051 and provide In-System Programmability Low power design. Less than 0.5mA required. LEDs indicate state of Socket Stealer during programming, erase, etc. Applications • • • To migrate an existing non-ISP compatible circuit board to an ISP design. For code development purposes – simply apply power and then continuously re-program the microcontroller. To convert an existing 8051 non-ISP compatible circuit board into an AVR (8515/4414) design. Compatible ISP Programmers • • • • • • Micro-ISP Series III/Series IV Professional Serial Programming System Micro-ISP Series III PLUS Professional Serial Programming System Low Voltage Micro-ISP Series III/Series IV Professional Serial Programming System Low Voltage Micro-ISP Series III PLUS Professional Serial Programming System AVR Activ8r Parallel and Serial Device Programmer 8051 Activ8r Parallel and Serial Device Programmer Equinox Technologies UK Limited UK Contact Details 3 Atlas House, St. Georges Square, Bolton BL1 2HB England Tel: +44 (0) 1204 529000 Fax: +44 (0) 1204 535555 E-mail: [email protected] Web site: www.equinox-tech.com US/Canada Contact Numbers Tel: 1-800-216-1777 Fax: 1-800-234-0941 89S/AVR(90S) Socket Stealer Ordering Information Order Code Description SS-89S8252-P 89S DIL-40 Socket Stealer. Accepts a DIL-40 device and plugs into a DIL-40 socket on target board. 89S PLCC-44 Socket Stealer. Accepts a DIL-40 device and plugs into a PLCC-44 socket on target board. 89S DIL-20 Socket Stealer. Accepts a DIL-40 device and plugs into a DIL-20 socket on target board. AVR (90S) DIL-40 Socket Stealer. Accepts a DIL-40 device and plugs into a DIL-40 socket on target board. AVR (90S) PLCC-44 Socket Stealer. Accepts a DIL-40 device and plugs into a PLCC-44 socket on target board. SS-89S8252-J SS-89S-20P SS-90S8515-P SS-90S8515-J Device Support (devices used with the Socket Stealer) AT89S8252-xxPx, AT89LS8252-xxPx, AT89S53xxPx, AT89LS53-xxPx Target Device Support (devices replaced by the Socket Stealer) Most generic 8051s in DIL-40 package. AT89S8252-xxPx, AT89LS8252-xxPx, AT89S53xxPx, AT89LS53-xxPx Most generic 8051s in PLCC-44 package AT89S8252-xxPx, AT89LS8252-xxPx, AT89S53xxPx, AT89LS53-xxPx AT89C1051-xxPx, AT89C2051xxPx, AT89C4051-xxPx AT90S4414-xPx, AT90S8515xPx AT90S4414-xPx, AT90S8515xPx AT90S4414-xPx, AT90S8515xPx AT90S4414-xJx, AT90S8515-xJx Equinox Technologies UK Limited UK Contact Details 3 Atlas House, St. Georges Square, Bolton BL1 2HB England Tel: +44 (0) 1204 529000 Fax: +44 (0) 1204 535555 E-mail: [email protected] Web site: www.equinox-tech.com US/Canada Contact Numbers Tel: 1-800-216-1777 Fax: 1-800-234-0941 89S/AVR(90S) Socket Stealer Document Version 1.0 Atmel 89S/AVR(90S) Socket Stealer 1. Introduction 1.1 Overview With the pressing timescales of modern-day electronic design, developers are often faced with the task of designing unproven circuitry onto a circuit board, only to find out that the design doesn’t work as expected when the PCB arrives back from manufacture. Implementing in-system programming (ISP) of Atmel microcontrollers for the first time on a circuit board is fraught with pitfalls as there are considerations such as choice of ISP header, power supply constraints, SPI contention problems, Reset timing problems etc. Debugging of such problems can be very time consuming as it is not possible to isolate just one cause. In light of all the potential problems with implementing ISP, Equinox have come up with a range of ‘ISP Socket Stealer Modules’ which convert an existing non-ISP compatible target board into a working ISP solution by simply plugging the module into the microcontroller socket on the target board. The ‘Socket Stealer’ incorporates all the necessary ISP hardware including ISP microcontroller, Reset circuit, ISP programmer connector and crystal. An ISP programmer such as the Equinox ‘Micro-ISP’ or ‘Activ8r’ connects to the ISP connector on the module and allows serial downloading/uploading of data from the module. The advanced electronic circuitry on-board the ‘Socket Stealer’ isolates all relevant programming lines during the ISP process ensuring that even with SPI bus contention, the microcontroller will still be able to be successfully programmed. It is also possible to leave the ‘Socket Stealer’ in the target socket even when a programmer is not connected making field code updates possible. The diagram below shows how the microcontroller plugs into the Socket Stealer which in turn plugs into a target board. A version of the Socket Stealer is also available that will allow it to plug into a PLCC-44 socket on the target board. Equinox Technologies UK Limited UK Contact Details 3 Atlas House, St. Georges Square, Bolton BL1 2HB England Tel: +44 (0) 1204 529000 Fax: +44 (0) 1204 535555 E-mail: [email protected] Web site: www.equinox-tech.com US/Canada Contact Numbers Tel: 1-800-216-1777 Fax: 1-800-234-0941 89S/AVR(90S) Socket Stealer The diagram below shows how an Equinox Micro-ISP programmer plugs into the Socket Stealer to allow In-System Programming (ISP) from a PC. 1.2 Applications • • • To migrate an existing non-ISP compatible circuit board to an ISP design. For code development purposes – simply apply power and then continuously re-program the microcontroller. To convert an existing 8051 non-ISP compatible circuit board into an AVR (8515/4414) design. Equinox Technologies UK Limited UK Contact Details 3 Atlas House, St. Georges Square, Bolton BL1 2HB England Tel: +44 (0) 1204 529000 Fax: +44 (0) 1204 535555 E-mail: [email protected] Web site: www.equinox-tech.com US/Canada Contact Numbers Tel: 1-800-216-1777 Fax: 1-800-234-0941 89S/AVR(90S) Socket Stealer 1.3 Socket Stealer Block Diagrams 1.3.1 89S (8051) Socket Stealer The block diagram below shows a simplified representation of the Socket Stealer as configured for an 89S device. 1.3.2 90S (AVR) Socket Stealer The block diagram below shows a simplified representation of the Socket Stealer as configured for a 90S device. Equinox Technologies UK Limited UK Contact Details 3 Atlas House, St. Georges Square, Bolton BL1 2HB England Tel: +44 (0) 1204 529000 Fax: +44 (0) 1204 535555 E-mail: [email protected] Web site: www.equinox-tech.com US/Canada Contact Numbers Tel: 1-800-216-1777 Fax: 1-800-234-0941 89S/AVR(90S) Socket Stealer 1.3.3 Block 1 – Equinox ISP Programmer This block represents an Equinox programmer featuring ISP. The diagram shows the key signals that the programmer provides to allow the Socket Stealer to function correctly. /RESET controls the reset of the microcontroller (block 3), /SS, MOSI, MISO and SCK are all used for programming of the microcontroller and PROG is used to control connection of the ISP signals to the target circuit (block 5). When PROG is active the switches are open. When an operation such as programming, erasing, etc. is not taking place all the signals from the programmer are high impedance. 1.3.4 Block 2 – Reset Circuit This block represents the reset circuit which is based on a RC network with some logic. The purpose of the circuit is to combine both the reset from the target board (block 5) and the reset from the programmer (block 1) into one signal for the microcontroller (block 3). This allows the microcontroller to be reset by both the programmer (during ISP) and the target board (for example on power up). 1.3.5 Block 3 – ISP Enabled Microcontroller This block represents the microcontroller that is plugged into the Socket Stealer. It must be an Atmel AT89S device such as the AT89S8252 or an Atmel AT90S4414/8515. Most of the I/O is connected straight to the target circuit (block 5). The ISP signals (/SS, MOSI, MISO and SCK) connect directly to the programmer (block 1) and through analogue switches (block 4) to the target circuit (block 5). 1.3.6 Block 4 – Analogue Switches These switches allow the programmer (block 1) to control when the ISP pins of the microcontroller (/SS, MOSI, MISO and SCK) are connected to the target circuit or not. During programming the PROG signal is active and the switches are open thereby disconnecting the ISP pins from the target circuit (block 5). This avoids any driver contention problems. When programming is not taking place or the programmer is disconnected the switches are closed thereby allowing the pins to be used for normal I/O. 1.3.7 Block 5 – Target Circuit Microcontroller Socket This block represents the socket on the target board where the microcontroller normally plugs in. When the Socket Stealer is being used it plugs into this socket instead. When an operation such as programming, erasing, etc. is not taking place the microcontroller on the Socket Stealer is effectively plugged into this socket. 1.4 Advantages of the Design • • • • • • Problems associated with designing In-System Programmable circuits have been removed Allows hardware on the SPI bus (/SS, MOSI, MISO and SCK) to be used with interfering with programming Adds In-System Programmability to existing designs that do not have this feature Target circuit redesign is not required Makes field upgradable firmware possible and easy to perform Enables designs to convert from an 8051 microcontroller to an AVR microcontroller more easily. Allows the crystal to be easily changed and the existing 8051 reset circuit can be used 1.5 Design Notes The use of analogue switches results in a series resistance being introduced on four of the microcontroller I/O lines. This could cause I/O port loading problems with some existing boards. Please refer to section 4 for further information on the analogue switch resistance. Equinox Technologies UK Limited UK Contact Details 3 Atlas House, St. Georges Square, Bolton BL1 2HB England Tel: +44 (0) 1204 529000 Fax: +44 (0) 1204 535555 E-mail: [email protected] Web site: www.equinox-tech.com US/Canada Contact Numbers Tel: 1-800-216-1777 Fax: 1-800-234-0941 89S/AVR(90S) Socket Stealer 2. Configuring the Socket Stealer 2.1 Configuration Overview • • • • • • • • • The Socket Stealer can be configured for a range of different target systems Links are used on the Socket Stealer PCB to select various features The type of device used in the Socket Stealer (89S or AVR) can be selected The type of RESET circuit (active high or active low) can be selected It is possible to select between the crystal on the target system or the crystal on the Socket Stealer For 89S devices the /EA pin can be either tied to Vcc or connected to /EA on the target system For 89S devices the /PSEN pin can be connected to /PSEN on the target system or left unconnected For AVR devices the ICP pin can be either tied to Vcc or connected to ICP on the target system For AVR devices the OC1B pin can be connected to OC1B on the target system or left unconnected 2.2 Supplied Configuration 2.2.1 AVR(90S) Socket Stealer • • • Configured to accept an AVR device and plug into an AVR target system. ICP and OC1B pins are connected to the target system The crystal on the Socket Stealer is selected. 2.2.2 89S Socket Stealer • • • Configured to accept an 89S device and plug into an 89S target system. /PSEN and /EA pins are connected to the target system The crystal on the Socket Stealer is selected. 2.3 Socket Stealer Links The following table is a summary of the links featured on the Socket Stealer. A more detailed description of each link follows. Link B1 B2 B3 and B4 B5 Pads Connected 1–2 2–3 1–2 2–3 1–2 2–3 1–2 2–3 B6 1–2 Meaning Target RESET circuit is configured for AVR devices (active low reset) Target RESET circuit is configured for 8051 devices (active high reset) Socket Stealer is configured to accept an AVR device Socket Stealer is configured to accept an 8051 device Socket Stealer uses the crystal on the target circuit Socket Stealer uses its own crystal. If a crystal is on the target circuit it is not used. 89S: Device /EA pin is connected to the target circuit /EA 90S: Device ICP pin is connected to the target circuit ICP 89S: Device /EA pin is connected to Vcc 90S: Device ICP pin is connected to Vcc 89S: Device /PSEN pin is connected to the target circuit /PSEN 90S: Device OC1B pin is connected to the target circuit OC1B Equinox Technologies UK Limited UK Contact Details 3 Atlas House, St. Georges Square, Bolton BL1 2HB England Tel: +44 (0) 1204 529000 Fax: +44 (0) 1204 535555 E-mail: [email protected] Web site: www.equinox-tech.com US/Canada Contact Numbers Tel: 1-800-216-1777 Fax: 1-800-234-0941 89S/AVR(90S) Socket Stealer 2.3.1 Links B1 and B2 – Microcontroller and Target Circuit Selection The Socket Stealer may plug into a target circuit that has been designed for an Atmel 90S4414/8535 AVR microcontroller or a generic 8051 microcontroller (please refer to the Device Support section). In addition it may accept an AVR 90S4414/8515 or 8051 89S device. The AVR family has an active low RESET and the 8051 family has an active high RESET resulting in reset circuits for the two families being different. In order to enable the Socket Stealer to plug into a target circuit that may have an incompatible reset circuit for the microcontroller two links are provided, B1 and B2. Link B1 selects the type of reset circuit on the target system. Connecting pads 1 and 2 together configures the Socket Stealer to plug into an AVR system and connecting pads 2 and 3 together configures the Socket Stealer to plug into an 8051 system. Link B2 selects the family of microcontroller plugged into the Socket Stealer itself. Connecting pads 1 and 2 together configures the Socket Stealer for an AVR 90S device and connecting pads 2 and 3 together configures the Socket Stealer for an 89S device. The way the reset circuit works on the Socket Stealer is to convert the target system RESET to active low if link B1 has 2 – 3 connected. This active low RESET signal is then ANDed with the RESET signal from the programmer, which is configured to always be active low. Then if link B2 has 2 – 3 connected the microcontroller is an 8051 device and the RESET signal requires inverting, producing an active high RESET. A simplified circuit diagram is shown below. Section 3.1 details how to configure the programmer so that the RESET signal produced is always active low. Equinox Technologies UK Limited UK Contact Details 3 Atlas House, St. Georges Square, Bolton BL1 2HB England Tel: +44 (0) 1204 529000 Fax: +44 (0) 1204 535555 E-mail: [email protected] Web site: www.equinox-tech.com US/Canada Contact Numbers Tel: 1-800-216-1777 Fax: 1-800-234-0941 89S/AVR(90S) Socket Stealer 2.3.2 Links B3 and B4 – Crystal Selection It is possible to choose between using a crystal on the target system or a crystal plugged into the Socket Stealer using links B3 and B4. This option allows designs for one microcontroller family (8051 or AVR) to migrate more easily to the other microcontroller family, as both families have different requirements for the crystal frequency. The crystal already on the target system does not need to be removed to use a crystal on the Socket Stealer. Connecting pads 1 and 2 together on both links B3 and B4 select the crystal on the target system. Connecting pads 2 and 3 together on both links B3 and B4 select the crystal on the Socket Stealer. A simplified circuit diagram is shown below. 2.3.3 Link B5 - /EA and ICP Configuration For 8051 devices the /EA pin selects between execution from internal or external memory. Link B5 allows this pin to be either connected to /EA on the target circuit or directly to the supply voltage Vcc on the Socket Stealer (selecting execution from internal memory). Connecting pads 1 and 2 together on link B5 connects the /EA pin to the target system /EA. Connecting pads 2 and 3 together on link B5 connects the /EA pin to Vcc. When using the 40-pin to 20-pin 8051 adaptor the /EA pin must be tied to Vcc for correct operation. This is due to the 20-pin 8051 devices not featuring /EA so when the adaptor is connected and /EA is not tied to Vcc by setting link B5 to 2 – 3, the /EA is left unconnected giving unreliable behaviour. On AVR devices the ICP pin controls the timer/counter 1 Input Capture function. Link B5 allows this pin to be either connected to the target circuit ICP or tied directly to Vcc on the Socket Stealer. If the input is being used then the pin should be connected to the target circuit otherwise it should be held at a constant logic level, either on the target circuit or by connecting the input directly to Vcc on the Socket Stealer. Connecting pads 1 and 2 together on link B5 connects the ICP pin to the target system ICP. Connecting pads 2 and 3 together on link B5 connects the ICP pin to Vcc. Equinox Technologies UK Limited UK Contact Details 3 Atlas House, St. Georges Square, Bolton BL1 2HB England Tel: +44 (0) 1204 529000 Fax: +44 (0) 1204 535555 E-mail: [email protected] Web site: www.equinox-tech.com US/Canada Contact Numbers Tel: 1-800-216-1777 Fax: 1-800-234-0941 89S/AVR(90S) Socket Stealer A simplified circuit diagram is show below. 2.3.4 Link B6 - /PSEN and OC1B Configuration On 8051 devices /PSEN is the external memory read strobe and link B6 allows this pin to either remain unconnected or connect to /PSEN on the target system. If pads 1 and 2 are connected together on link B6 then the pin is connected to the target system. This is only required if external program memory is being used. On AVR devices OC1B is the output pin for the timer/counter 1 Output CompareB function. This pin may either be left unconnected or connected to OC1B on the target system. If pads 1 and 2 of link B6 are connected then the pin is connected to the target system. This is only required if the timer/counter 1 Output CompareB function is required. A simplified circuit diagram is shown below. Equinox Technologies UK Limited UK Contact Details 3 Atlas House, St. Georges Square, Bolton BL1 2HB England Tel: +44 (0) 1204 529000 Fax: +44 (0) 1204 535555 E-mail: [email protected] Web site: www.equinox-tech.com US/Canada Contact Numbers Tel: 1-800-216-1777 Fax: 1-800-234-0941 89S/AVR(90S) Socket Stealer 2.4 Socket Stealer Links Diagram This is the view of the underside of the Socket Stealer looking at the DIL pins. Each link (B1 to B6) is made up of two or three square pads which are numbered as shown in the diagram. 2.5 40-pin to 20-pin 8051 Adaptor The Socket Stealer can plug into a 40-pin DIL to 20-pin DIL adaptor which allows it to be used in place of an Atmel 20-pin 8051 device (AT89C1051/2051/4051). The 20-pin devices however do not feature an /EA pin, so if link B5 has pads 1 and 2 connected then the /EA pin of the microcontroller is left unconnected. This can cause unreliable operation for example “Programmer not detected” errors, incorrect programming, reading, verification and erasing may result. When using the adaptor link B5 should be set to 2 – 3 to connect /EA to Vcc. Equinox Technologies UK Limited UK Contact Details 3 Atlas House, St. Georges Square, Bolton BL1 2HB England Tel: +44 (0) 1204 529000 Fax: +44 (0) 1204 535555 E-mail: [email protected] Web site: www.equinox-tech.com US/Canada Contact Numbers Tel: 1-800-216-1777 Fax: 1-800-234-0941 89S/AVR(90S) Socket Stealer 3. Using the Socket Stealer 3.1 Configuring Meridian 8051 devices have an Active High RESET and AVR devices have an Active Low RESET. By setting the links on the socket stealer it can be configured to accept an AVR or 8051 device and plug into a target system with a RESET circuit designed for an AVR or 8051 device. In order for the Socket Stealer to work correctly the ISP programmer (Micro-ISP or Activ8r) must itself be configured to produce an Active Low RESET regardless of the device family that is being used. An Active Low RESET is selected automatically in Meridian when an AVR device is chosen, however every time an 89S device is chosen the RESET is set to Active High. The PROG signal from the programmer can also be configured for Active High or Active Low operation. Normally this signal is Active Low but when using the Socket Stealer it has to be configured as Active High. The following steps describe how to change the RESET to Active Low and to set PROG to Active High: 1. From the Options menu choose “ISP Settings…” 2. Click on “Active low” in the Reset box. 3. Click on “Active High” in the PROG/Shutdown box. 4. Click on the “OK” button. The screenshot below shows the ISP Interface Settings dialogue box for an AT89S8252 with the Reset and PROG set accordingly for an 89S Socket Stealer. Equinox Technologies UK Limited UK Contact Details 3 Atlas House, St. Georges Square, Bolton BL1 2HB England Tel: +44 (0) 1204 529000 Fax: +44 (0) 1204 535555 E-mail: [email protected] Web site: www.equinox-tech.com US/Canada Contact Numbers Tel: 1-800-216-1777 Fax: 1-800-234-0941 89S/AVR(90S) Socket Stealer 3.2 LEDs There are two LEDs on the Socket Stealer. The green LED indicates that that the programmer is active and an operation such as read, verify, erase or program is being performed. The red LED indicates that the RESET of the microcontroller is active. 3.3 89S Device Locking It is possible to lock 89S devices so they cannot be In-System programmed again due to a bug in the silicon. This can be avoided by ensuring that your firmware does not write to the SCK pin of the 89S device within the first 700ms of execution, possibly by including a large initial loop. 4. Technical Information This section describes various aspects of the Socket Stealer that you should bear in mind when designing a target system or when using the Socket Stealer with an existing design. 4.1 Current Consumption The Socket Stealer draws approximately 0.5mA of current from the target circuit when the supply voltage Vcc is +5V. 4.2 Analogue Switch Resistance Each analogue switch has a resistance when closed of 470Ω. This can have an effect on any hardware connected to pins P1.4/PB4, P1.5/PB5, P1.6/PB6 and P1.7/PB7 on the target circuit due to the voltage drop across the switch. 5. Device support Please note that although supported devices may have a range of possible supply voltages, the Socket Stealer has been designed to operate only with a supply voltage of +5V. 5.1 Devices Inserted into the Socket Stealer The Socket Stealer will accept the following Atmel 8051 devices providing the links are set correctly: • AT89S8252 • AT89S53 • AT89LS8252 (+5V Vcc only) • AT89LS53 (+5V Vcc only) The Socket Stealer will accept the following Atmel AVR devices providing the links are set correctly: • AT90S4414 • AT90S8515 Please refer to section 2.3 for information on the Socket Stealer links. Equinox Technologies UK Limited UK Contact Details 3 Atlas House, St. Georges Square, Bolton BL1 2HB England Tel: +44 (0) 1204 529000 Fax: +44 (0) 1204 535555 E-mail: [email protected] Web site: www.equinox-tech.com US/Canada Contact Numbers Tel: 1-800-216-1777 Fax: 1-800-234-0941 89S/AVR(90S) Socket Stealer 5.2 Target Circuit Devices The Socket Stealer can plug into a target circuit in place of most 40-pin generic 8051 devices and the following Atmel 20-pin 8051 devices with the 40-pin to 20-pin adaptor, providing the links are set correctly: • AT89C1051(U) • AT89C4051 • AT89C2051 The Socket Stealer can plug into a target circuit in place of the following 40-pin AVR devices providing the links are set correctly: • AT90S4414 • AT90S8515 Please refer to section 2.3 for information on the Socket Stealer links. Equinox Technologies UK Limited UK Contact Details 3 Atlas House, St. Georges Square, Bolton BL1 2HB England Tel: +44 (0) 1204 529000 Fax: +44 (0) 1204 535555 E-mail: [email protected] Web site: www.equinox-tech.com US/Canada Contact Numbers Tel: 1-800-216-1777 Fax: 1-800-234-0941