Usbbigmultio
USB IO
This is the documentation page for the USBbigmultio PCB.
overview
The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.
External resources
pinout
20 Pin connector SV1 is connected as follows
1 | GND |
2 | GND |
3 | PB0 (SS / PCINT0) |
4 | PB1 (PCINT1 / SCLK) |
5 | PB2 (PDI / PCINT2 / MOSI) |
6 | PB3 (PDO / PCINT3 / MISO) |
7 | PB4 (PCINT4 / ADC11) |
8 | PB5 (PCINT5 / OC1A / /OC4B / ADC12) |
9 | PB6 (PCINT6 / OC1B / OC4B / ADC13) |
10 | PB7 (PCINT7 / OC0A / OC1C / /RTS) |
11 | PD0 (OC0B / SCL / INT0) |
12 | PD1 (SDA / INT1) |
13 | PD2 (RXD1 / INT2) |
14 | PD3 (TXD1 / INT3) |
15 | PD4 (ICP1 / ADC8) |
16 | PD5 (XCK1 / /CTS) |
17 | PD6 (T1 / /OC4D / ADC9) |
18 | PD7 (T0 / OC4D / ADC10) |
19 | VCC |
20 | VCC |
20 Pin connector SV2 is connected as follows
1 | GND |
2 | GND |
3 | PC6 (OC3A / /OC4A) |
4 | PC7 (ICP3 / CLK0 / OC4A) |
5 | PE2 (/HWB) |
6 | PE6 (INT6 / AIN0) |
7 | PF0 (ADC0) |
8 | PF1 (ADC1) |
9 | PF4 (ADC4 / TCK) |
10 | PF5 (ADC5 / TMS) |
11 | PF6 (ADC6 / TDO) |
12 | PF7 (ADC7 / TDI) |
13 | PF1 (ADC1) |
14 | NC |
15 | PF5 (ADC5 / TMS) |
16 | NC |
17 | PF7 (ADC7 / TDI) |
18 | AREF |
19 | VCC |
20 | VCC |
- led1 is connected to VCC
- led2 is connected to PF6
- led3 is connected to PF7
- led4 is connected to PE2
Jumper settings
J1 | J2 | IC1 | |
5V | 1 | 0 | NOT mounted |
3V3 <50mA | 0 | 1 | NOT mounted |
3V3 >50mA | 0 | 0 | mounted |
3V3 operation is not supported, but may or may not work in your application.
programming
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
Linux
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh if [ -z "$CHIP" ] ; then chip=at90usb162 else chip=$CHIP fi hex=$1 sudo dfu-programmer $chip erase sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
windows
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
writing programs
The chip is an ATmega32U4. http://www.atmel.com/dyn/resources/prod_documents/doc7766.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
future hardware enhancements
- Make an I2C header
future software enhancements
- program the LUFA bootloader.
- Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
Changelog
1.1
- Added ICSP connector (can function as ISP slave, master, or SPI connector)
- Added header parallel to reset switch
1.0
- Initial release