You are viewing outdated content for BUG. If you have a BUG Y.T. edition or 2.0 series device, please visit our updated wiki: http://wiki.buglabs.net
BUGduino
From BUG Wiki
The BUGduino Module
- If you have one of the prototype BUGduinos have a look at the issues we've identified.
- This page contains BUGduino technical specifications and assorted general information. For information on how to program the BUGduino, see Getting Started with the BUGduino
Contents |
Introduction
The BUGduino was designed and built to make the development of custom hardware for your bug as painless as possible! It's an open ended platform upon which you can build whatever you want. The BUGduino is essentially an AVR breakout board that will play very nicely with your BUGbase. Also, as you might have already guessed, BUGduino is fully Arduino-compatible. This means that it can be programmed using the Arduino IDE, and can be fitted with many of the shields that have already been designed by the members of the Arduino community.
So hold on a second . . . Doesn't Bug already offer a VonHippel module that does just that? Err, well yes . . . the VonHippel and BUGduino are very similar in some ways, but there are also some very important differences. If you are not sure which module would serve your project best, take a look at the chart in the next section:
VonHippel vs. BUGduino

*Max sample rate determined by precision (10bit vs 8bit)
WARNINGS
Ok, so lets get the WARNINGS out of the way first so that you can go about using BUGduino with some peace of mind. Before you start using BUGduino you should be familiar with the basic architecture of the BUGbase and you should be aware that any circuitry that you connect to BUGduino has the potential to damage both your BUGduino module and the connected BUGbase. Please use ALL connections with care. Do, however, note that some of these connections, if used improperly, could cause more extensive damage than others. Some of the pins on BUGduino expose direct connections to the BUGbase CPU and the application of voltages in excess of those specified below are likely to cause irreparable damage to your BUGbase. To be clear, some connections have potential to damage only BUGduino, others have potential to damage only the connected BUGbase, and others could cause damage to both. Below you will see a table of BUGduino's connections and their voltage limitations. In addition, the table has been color coded to differentiate between the pins that may affect only BUGduino, and those that may cause more extensive damage. Under no circumstances should you introduce voltages to these pins that exceed the specifications below.

*Do not apply power to any of the VCC pins when BUGduino is plugged into a BUGbase

*Do not apply power to any of the VCC pins when BUGduino is plugged into a BUGbase
Cells in RED denote connections that, if used improperly, have the potential to damage the BUGbase, or both the BUGbase and BUGduino.
Cells in YELLOW denote connections that, if used improperly, have the potential to damage only BUGduino.
Protection
The following measures of over-voltage protection have been built into BUGduino to offer a bit of protection for sensitive connections to the BUGbase.
Voltage protection on VCC [D5]
A Schottky diode on the VCC rail follows the BUGduino's voltage regulators and provides reverse voltage protection for the BUGbase up to 10V. Note that applying voltages greater than 5V to the VCC rail will damage components local to the BUGduino as indicated by the table above.
Serial Line Shift [U6]
A MAX3375 level translator sits on the serial lines between the BUGbase and the BUGduino. This component is necessary for other reasons but it also serves as a buffer for these serial lines and offers additional protection for the BUGbase.
Voltage protection on I2C [D2 and D3]
A Zener diode (reversed to ground) sits on each of the I2C lines (SDA and SCL) and provides over-voltage protection.
Block Diagram
A general idea of what the BUGduino has going on; block diagram style:
Header Pinout
Header pinouts can also be found on the schematic, and are printed on the PCB.
Hardware
[U1] Microcontroller
Manufacturer: Atmel
Part Number: ATMega328P [Datasheet]
The Atmel AVR family of microcontrollers is a favorite among hardware hackers for a number of reasons. These chips have a robust feature set, are inexpensive, and they're also very well documented (both by the community and by Atmel).
[U2] I2C I/O Expander
Manufacturer: NXP Semiconductor
Part Number: PCA9538PW [Datasheet]
I2C Address: 0xE2
The BUGduino's I/O Expander (IOX) offers 8 additional I/O pins on top of the 21 that are already available on the AVR's B, C, and D ports. These 8 IOX pins (IOX0:IOX7), when configured as outputs, are controlled by commands delivered to the I2C bus by the BUGbase. When configured as inputs, a state change on an IOX pin will set the interrupt line to the BUGbase which may then interrogate the PCA9538 to determine which pin has changed.
[U3] I2C EEPROM
Manufacturer: Atmel
Part Number: AT24C02B [Datasheet]
I2C Address: 0xA0
The BUGduino's EEPROM sits on the I2C bus and stores the identity of your BUGduino module. When the module is plugged into your BUGbase, the the base CPU reads the EEPROM via I2C and uses the information that it receives to determine what module was plugged in. Based on this information the proper driver is loaded abd the module is initialized. In most cases you can just pretend that this doesn't exist. This chip is powered by VCC but its power connection is located just before the Schottky protection diode (D5). The implication of this is that the EEPROM is only powered when the module is plugged into a BUGbase.
[U4, U5] Power Regulators
Manufacturer: National Semiconductor
LP38963MP-3.3 and LP38963MP-5.0 (U4 and U5) [Datasheet]
Because we found it to be a very useful on our Seeeduino, we decided to add switchable 3.3V and 5.0V operation to BUGduino. By design, these regulators will only regulate power from the BUGbase. If you connect a power source to one of the three VCC pins that are exposed, you will be connecting directly to the power rail that feeds most of the components on BUGduino. Please make sure that you regulate your power (see: WARNINGS) if you decide to operate your BUGduino while it's detached from your BUGbase.
[U6] Serial Line Level Translator
Manufacturer: Maxim
MAX3375EEKA (U6) [Datasheet]
The MAX3375 is a level translator that sits on the serial lines between the BUGbase and the BUGduino. This chip ensures that the BUGbase receives logic levels between 0V and 3.3V regardless of what is happening on the BUGduino side of the serial connection. This chip serves as protection for the BUGbase in that it is a buffer against over-voltage, but it is also completely necessary considering that if the BUGduino is operating in 5.0V mode, the serial signal logic high voltage will also be 5.0V.
The MAX3375 also has a high Z (aka '3 state') mode which allows the serial connection between the Base and the BUGduino to be effectively switched 'off'. When the chip is in 3 state mode (GPIO0 = Low) the connections on both sides of the chip will see high impedance which basically acts like an open circuit.
[D1, RST, PWR, PB5_LED] LEDs
BUGduino has five LEDs. Here is everything you need to know about them:
Interfaces
When working with these interfaces, please make sure that you have read and understand the WARNINGS.
Serial
The BUGduino's ATMega328P [U1] uses a 2-wire serial connection to communicate with the BUGbase. This is the only device on the BUGduino that has a serial connection. Please be aware that circuitry connected to PD0 and PD1 on header J3 may affect serial communication. These pins (PD0 and PD1) are both I/O pins and the RX and TX pins associated with the AVR's UART hardware. Please be aware of the voltage requirements of these lines.
I2C
The BUGduino has the following devices connected to the I2C bus.
The SDA and SCL signals are made available on the BUG2 header. Additional devices may be attached to this bus. Please be aware of the addresses that are already occupied as well as the voltage requirements of these lines.
SPI
The BUGbase has an SPI interface available to each slot, however, the BUGduino does not make use of this interface. The pins necessary to connect to this interface are made available on the BUG2 header. Please note that this interface requires the use of an active low slave select (SPI_SS) signal. SPI devices that require an active high SPI_SS signal may be used so long as a signal inverter is placed inline with this signal.
Programming
See Getting Started with the BUGduino for information on programming the BUGduino through the BUGbase
So you want to program the AVR that lives on your BUGduino? Of course you do! Here are the ways that you can do it:
Arduino IDE – Being that BUGduino is a fully Aruduino-compatible board, you can use the sketches that you've built in the Arduino IDE and upload them to the board using the one-click method that you've come to know and love. Connecting your PC to BUGduino works a bit differently but here is how it's done.
1) FTDI header – The FTDI header on the BUGduino is laid out to accept an FTDI cable for serial connections. This cable is an extremely useful tool to have lying around, and you can get one here. Unfortunately, the FTDI cable breaks out the RTS pin instead of the DTR pin that the Arduino bootloader is designed to work with. The folks over at SparkFun are familiar with this issue and were kind enough to put together an FTDI board to solve exactly this problem. Using the SparkFun FTDI board programming your BUGduino will be exactly like programming an Arduino; Just plug the FTDI board into your BUGduino's FTDI header, connect the FTDI board to your computer via USB, select the USB port in the Arduino environment, and click the upload button.
2) Connect through BUGbase – Eventually you'll be able to program Bugduino through your BugBase. This isn't ready yet, sorry.
ISP - A standard 6 pin Atmel in-system-programmer (ISP) is built into BUGduino. You might recognize this header, it's labeled 'ISP'. In order to use it, you will need an AVR programmer. We recommend this one from Atmel: AVRISPMKII. Programming the BUGduino this way (or the Arduino for that matter) is a bit more involved but is much more powerful. Programming in C gives you the ability to access all of the AVR's many features [datasheet] and the barriers to entry are very low thanks to all the great support that is available on the web.
Other Features
Resources
Data Sheets/Documents
Issues
These are the issues that have been identified so far and will be fixed on the next rev:
- No silkscreen for voltage selector switch. Switch toward outside, VCC = 3.3; Switch toward inside, VCC = 5V
- PB5 LED mounted backwards =(
- The bugbase<->bugduino serial only works one way( from the bugbase(tx) to the bugdiono(rx) )
- Programming only works when the button is switched to 5V(with the sparkfun FTDI cable)



