Many 3 wire protocols can be formed using the bus manipulations available in this mode. Raw 2 wire mode uses the same pin configuration as I2C.Hardware Click for a full size PCB placement image (PNG). Raw 3 wire mode uses the same pin configuration as SPI. The circuit and PCB are designed using the freeware version of Cadsoft Eagle. We used a PIC24FJ64GA002 microcontroller in the Bus Pirate; this is the same chip we used in our mini-server project.We type commands into a serial terminal on the computer.The commands go to the Bus Pirate through the PC serial port.MAX RS232 transceivers require four 0.1u F capacitors for a charge pump (C4,5,7,8), and one decoupling capacitor (C17). We used a MAX3223CPP, which doesn’t seem to be available anymore. Any number not preceded by 0x, 0h, or 0b is interpreted as a decimal value. The 24LC1025 base address is 1010xxy, where xx is determined by the state of pins 2 and 3, and y is read (1) or write (0) mode.MAX3223EEPP is a pin-compatible newer version, available at Digikey for . None of the 3223’s power saving features are used, so a cheaper, simpler 3.3volt RS232 transceiver should be substituted if at all possible. We tied pins 2 and 3 high, making the full write address 1010110.We also wanted a 3.3volt device with 5volt tolerant inputs, but most popular through-hole USB microcontollers were 5volt parts (e.g. The Bus Pirate currently ‘speaks’ three hardware protocols for high-speed interfacing, and has two software protocol libraries for easy bus manipulation.
Each power pin needs a decoupling capacitor(C12,13), and the MCLR function requires a resistor (R7) between pin 1 and 3.3volts. Terminals should be set to ASCII mode with local echo, we used the Windows serial terminal. The Bus Pirate should respond to any single line feed type (0x0a, 0x0d), or both (Windows style).The Bus Pirate talks to a microchip in the proper protocol, and returns the results to the PC. On-board 3.3volt and 5volt power supplies are available to power the connected chip.Software configurable I2C pull-up resistors complete the package.This chip converts 3.3volt serial output to /-10volt RS232 signals compatible with a PC serial port. If the EEPROM responds, we can send the data location to write (2 bytes) and data payload (n bytes).The MAX3223CPP is a 3-5volt version of the MAX202, with extra power saving features. Any combination is fine, no delimiter is required between non-number values: . The Bus Pirate automatically checks for an ACK at the end of each write, and ACKs each read.Pins 14,15,16,17,18,21, and 22, are digital only, which we determined by looking through the datasheet and eliminating any pins with an analog connection type (table 1-2, pages 11-16). The on-board SDA/SCL pull-up resistors hold the I2C bus high, and eliminate the need for external resistors.According to the datasheet, I2C pins are also 5volt tolerant. A single 0.1u F capacitor decouples the EEPROM from the power supply.This is a generic 3 wire protocol library, similar to SPI but without the constraints of a hardware module.Use this library to work with devices that use non-8bit compatible 3-wire protocols, like the Sparkfun Nokia 6100 LCD knock-off. This table shows the pin connections for each bus mode.The PIC has an internal voltage regulator that requires a 10u F tantalum capacitor (C3), though we used a plain electrolytic capacitor without issue. Microchip’s EEPROMS are popular permanent-storage memory chips, the 24LC1025 has 128Kbytes of storage with an I2C interface.Read about programming and working with this chip in our PIC24F tutorial. We can test this chip without bread-boarding a big circuit or writing code.Most chips can be powered from the Bus Pirate’s on-board 3.3volt and 5volt supplies. We’ll start writing to the device at the first data location ( Reading the 24LC1025 takes two steps.5volts is supplied by a common 7805 regulator (VR2) and two decoupling capacitors (C9,10). First, a write command with no data sets the address pointer.There’s a bunch of conflicting information on the web, but datasheet page 230, parameter DI28, clearly states that the max input for a 24FJ64GA002 I2C pin without analog circuitry is 5.5volts. All I2C operations begin with a start condition or ].