~~META: description abstract = usb serial interface ~~ ====== Bus Pirate ====== Jonathan and Bill each have a [[http://hackaday.com/the-bus-pirate-universal-serial-interface/|Bus Pirate v3]] ====== Connecting to a Makerbot Cupcake ====== If you do not have a usb to ftdi cable, you can use a bus pirate. Here is how we setup a bus pirate v3 with firmware and bootloader 4.1 to a Cupcake ( bot 779, batch 11, motherboard firmware XXXX, plastruder firmware XXXX ). ===== Hardware Setup ===== Before plugging in the bus pirate, we need to make sure we are using +5v to communicate with the makerbot motherboard. Normally the bus pirate communicates with 3.3v, but luckily for us an internal pullup resistor can bring it up to 5v. Jump the Vup and +5v pins on the board. There are only three more wires to connect, then we can setup the software. Connect ground to ground (pin 1 on the makerbot motherboard v1.2), BP **MISO** to Makerbot **RXD** (pin 5), and BP **MOSI** to Makerbot **TXD** (pin 4). This is because the Makerbot is based on a sanguino, so it is a DCE chip, and the bus pirate is DTE. Now plug in the usb connection to the computer. The makerbot can be kept off until you open replicatorG. ===== Udev Rule ===== The bus pirate can show up as /dev/ttyUSBX, with X being any digit. A udev rule to always show up as /dev/buspirate is convenient. * Get the serial number of this particular bus pirate: # sudo udevadm info --attribute-walk -n /dev/ttyUSB0 | sed -n '/FTDI/,/serial/p' * And replace XXXXXX with that serial number: # sudo echo 'SUBSYSTEM=="tty", ATTRS{serial}=="XXXXXX", GROUP="users", MODE="0660", SYMLINK+="buspirate"' | sudo tee /etc/udev/rules.d/98-buspirate.rules * Reload the rules for udev, and re-plugin the bus pirate # sudo udevadm control --reload-rules ===== Connecting with minicom ===== Install minicom, and run # sudo minicom -s * Navigate with the arrow keys and enter, choosing **Serial port setup** and pressing 'A' to change the **serial device** to '/dev/buspirate' * Set **Hardware Flow Control** and **Software Flow Control** to off * Exit, and choose **Save setup as dfl** so we can skip this part next time Now exit and minicom should automagically connect to the bus pirate, giving you a command prompt. ===== Setting up a UART connection ===== Type //M// for the menu, then choose * //3// for **UART** mode * //7// for **38400** baud * //1// for **8, NONE** bits and parity * //1// for **1** stop bits * //1// for **1** receive polarity * //1// for **Open drain (H=Hi-Z, L=GND)** output type You should be back at the serial prompt. * Type CAPITAL //W// to set the **power supplies on** * Type //p// and then //2// to turn the **pullup on** * Type //(1)// to run the **UART bridge** macro The bus pirate output has already been set to 38400 baud, but we now need to change the baud rate between the computer and bus pirate to 38400. * Type //B// and then //7// to set the bus pirate baud to **38400**. **Do not press space** yet! * In minicom, press //Control-A// and then //p// to access the **Comm Parameters** screen * Press //b// and then //b// again to bring the terminal baud rate down to **38400** (from 115200) and then press //enter// * Now you can press //space// If all is good, the bottom of minicom should show we are communicating at **38400 8N1** and you are back to the regular menu. * In minicom, press //Control-A// then CAPITAL //X// to **exit without reset** ===== Final steps ===== Congratulations, you are now ready to use replicatorG to test your makerbot! ===== Updating Firmware ===== When updating the plastruder firmware, make sure to be at **19200** baud rate! {{tag>projects makerbot arduino}}