This is part of the EMDP1 project and it is currently a work in progress.
Plugs are available for the following processors:
The EMDP1 plug has 80 pins arranged in a 20 rows by 4 column array. The left 2×20 pins are cross wired to the ZIF40 socket. Thus, the upper left pin is 1 going down the left side until 20, moving over one pin to 21 and back up to 40. An `L' is put in front of these pins to distinguish them from the pins on the right. The right 2×20 pins are labeled using cable pin numbering that starts in the upper left with 1, goes down in odd pin numers until 39, then returns to the top right with 2, and goes down the right until 40. Again, the right pins are prefixed with an `R' to distinguish them from the ones on the left. The table below should help keep track of this admittedly confusing pin numbering:
Note: BD27 (pin 35) is not a bi-directional pin on the EMDP1; it is used by the bootstrap adaptor to feed 13 volts back to the PIC16F877 in the EMPD1 for programming.
Column 1 Column 2 Column 3 Column 4 Row Pin No. Label Pin No. Label Pin No. Label Pin No. Label 1 L1 ZIF40:1 L40 ZIF40:40 R1 SCK_SCL R2 GND 2 L2 ZIF40:2 L39 ZIF40:39 R3 SDI_SDA R4 SDO 3 L3 ZIF40:3 L38 ZIF40:38 R5 TXD? R6 +5V 4 L4 ZIF40:4 L37 ZIF40:37 R7 RXD R8 BD0 5 L5 ZIF40:5 L36 ZIF40:36 R9 BD1 R10 BD2 6 L6 ZIF40:6 L35 ZIF40:35 R11 BD3 R12 BD4 7 L7 ZIF40:7 L34 ZIF40:34 R13 BD5 R14 BD6 8 L8 ZIF40:8 L33 ZIF40:33 R15 BD7 R16 BD8 9 L9 ZIF40:9 R32 ZIF40:32 R17 BD9 R18 BD10 10 L10 ZIF40:10 L31 ZIF40:31 R19 BD11 R20 BD12 11 L11 ZIF40:11 L30 ZIF40:30 R21 BD13 R22 BD14 12 L12 ZIF40:12 L29 ZIF40:29 R23 BD15 R24 BD16 13 L13 ZIF40:13 L28 ZIF40:28 R25 BD17 R26 BD18 14 L14 ZIF40:14 L27 ZIF40:27 R27 BD19 R28 BD20 15 L15 ZIF40:15 L26 ZIF40:26 R29 BD21 R30 BD22 16 L16 ZIF40:16 L25 ZIF40:25 R31 BD23 R32 BD24 17 L17 ZIF40:17 L24 ZIF40:24 R33 BD25 R34 BD26 18 L18 ZIF40:18 L23 ZIF40:23 R35 BD27 R36 VAR1 19 L19 ZIF40:19 L22 ZIF40:22 R37 VAR2 R38 NC1 20 L20 ZIF40:20 L21 ZIF40:21 R39 NC2 R40 NC3
It is desirable to determine whether or not a plug is being used or and adaptor board is being used. BD25 and BD26 are used for this purpose. Both these lines have a 10K ohm pull up resistor tied to +5 volts. All plugs tie BD25 to ground and all adaptor boards tile BD26 to ground. The following table is used to figure out what is going on:
There is enough information avaible to provide a meaningful error message to the user if they have forgotten to plug anything in and if they have accidentally plugged in both an adaptor board and and a plug.
BD25 BD26 Description 0 0 Error -- Both a plug and adaptor board are plugged in at the same time. 0 1 Only a plug is plugged into the EMDP1. 1 0 Only an adaptor board is plugged into the EMDP1. 1 1 Error -- Neither a plug nor an adaptor board are plugged into the EMDP1.
All adaptor boards have have a serial EEPROM to provide further adaptor board identification. However, some plugs have serial EEPROM's and some do not. Line BD24 is used to figure this out. Line BD24 it tied to ground if there is a serial EEPROM on the plug and it is tied to +5 volts if there is not a serial EEPROM.
If there is not a serial EEPROM on the plug (i.e. BD24 = +5 volts), the next 12 BD lines, BD23 through BD12 are used a plug identifier. This allows there to be up to 212 = 4098 distinguishable different EMDP1 plugs that do not have serial EEPROM's.
The table below lists the uses for the various BD lines:
Having 12 bits of ID theorietically provides 212 = 4098 different possible plugs. In reality, some of the plugs will need to use some of the lines to control the device being programmed. Thus, it is anticipated that substantially fewer than 4098 plug identifiers will be used.
Plug Pin Label Use R34 BD26 AD = Adaptor Detect (0=adaptor present; 1=not present) R33 BD25 PD = Plug Detect (0=plug present; 1=not present) R32 BD24 SED = Serial EEPROM Detect (0=present; 1=not present) R31 BD23 ID0 = Identifier Bit 0 R30 BD22 ID1 = Identifier Bit 1 R29 BD21 ID2 = Identifier Bit 2 R28 BD20 ID3 = Identifier Bit 3 R27 BD19 ID4 = Identifier Bit 4 R26 BD18 ID5 = Identifier Bit 5 R25 BD17 ID6 = Identifier Bit 6 R24 BD16 ID7 = Identifier Bit 7 R23 BD15 ID8 = Identifier Bit 8 R22 BD14 ID9 = Identifier Bit 9 R21 BD13 ID10 = Identifier Bit 10 R20 BD12 ID11 = Identifier Bit 11
The id's are allocated linearly as shown in the table below:
Id Plug Processor(s) 0 X0 Used for homebrew plugs 1 PIC8 8-pin & 14-pin MicroChip PIC's 2 PIC18 18-pin MicroChip PIC's 3 PIC28 28-pin & 40-pin MicroChip PIC's 4 AVR820 8-pin & 20-pin Atmel AVR's 5 AVR26 Atmel ATtiny26 6 AVR28 28-pin Atmel AVR's 7 AVR40 Some 40-pin Atmel AVR's 8 AVR41 Some additional 40-pin Atmel AVR's
Lastly, in order to prevent plug from being plugged in backwards, a single wire extends upward from the mother board through a hole in each plug. This provides a very inexpensive way of polarizing the plugs.