Difference between revisions of "Usbbigmultio"

From BitWizard Wiki
Jump to navigation Jump to search
 
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= USB IO =
= USB IO =


This is the documentation page for the USBbigmultio PCB.
This is the documentation page for the USB bigmultio PCB.


The USB bigMultio PCB can be bought in the [http://www.bitwizard.nl/shop/avr-boards/usb-bigmultio BitWizard shop].
== overview ==

== Overview ==


The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.
The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.


== pinout ==
== Assembly instructions ==

== External resources ==

=== Datasheets ===
* [http://www.atmel.com/Images/Atmel-7766-8-bit-AVR-ATmega16U4-32U4_Datasheet.pdf ATmega16/32U4 datasheet]

== Additional software ==
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]

=== Related projects ===

== Pinout ==


20 Pin connector SV1 is connected as follows
20 Pin connector SV1 is connected as follows
Line 14: Line 28:
<tr><td>1</td><td>GND</td></tr>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PB0</td></tr>
<tr><td>3</td><td>PB0 (SS / PCINT0)</td></tr>
<tr><td>4</td><td>PB1</td></tr>
<tr><td>4</td><td>PB1 (PCINT1 / SCLK)</td></tr>
<tr><td>5</td><td>PB2</td></tr>
<tr><td>5</td><td>PB2 (PDI / PCINT2 / MOSI)</td></tr>
<tr><td>6</td><td>PB3</td></tr>
<tr><td>6</td><td>PB3 (PDO / PCINT3 / MISO)</td></tr>
<tr><td>7</td><td>PB4</td></tr>
<tr><td>7</td><td>PB4 (PCINT4 / ADC11)</td></tr>
<tr><td>8</td><td>PB5</td></tr>
<tr><td>8</td><td>PB5 (PCINT5 / OC1A / /OC4B / ADC12)</td></tr>
<tr><td>9</td><td>PB6</td></tr>
<tr><td>9</td><td>PB6 (PCINT6 / OC1B / OC4B / ADC13)</td></tr>
<tr><td>10</td><td>PB7</td></tr>
<tr><td>10</td><td>PB7 (PCINT7 / OC0A / OC1C / /RTS)</td></tr>
<tr><td>11</td><td>PD0</td></tr>
<tr><td>11</td><td>PD0 (OC0B / SCL / INT0)</td></tr>
<tr><td>12</td><td>DP1</td></tr>
<tr><td>12</td><td>PD1 (SDA / INT1)</td></tr>
<tr><td>13</td><td>PD2</td></tr>
<tr><td>13</td><td>PD2 (RXD1 / INT2)</td></tr>
<tr><td>14</td><td>PD3</td></tr>
<tr><td>14</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>15</td><td>PD4</td></tr>
<tr><td>15</td><td>PD4 (ICP1 / ADC8)</td></tr>
<tr><td>16</td><td>PD5</td></tr>
<tr><td>16</td><td>PD5 (XCK1 / /CTS)</td></tr>
<tr><td>17</td><td>PD6</td></tr>
<tr><td>17</td><td>PD6 (T1 / /OC4D / ADC9)</td></tr>
<tr><td>18</td><td>PD7</td></tr>
<tr><td>18</td><td>PD7 (T0 / OC4D / ADC10)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
Line 39: Line 53:
<tr><td>1</td><td>GND</td></tr>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC6</td></tr>
<tr><td>3</td><td>PC6 (OC3A / /OC4A)</td></tr>
<tr><td>4</td><td>PC7</td></tr>
<tr><td>4</td><td>PC7 (ICP3 / CLK0 / OC4A)</td></tr>
<tr><td>5</td><td>PE2</td></tr>
<tr><td>5</td><td>PE2 (/HWB)</td></tr>
<tr><td>6</td><td>PE6</td></tr>
<tr><td>6</td><td>PE6 (INT6 / AIN0)</td></tr>
<tr><td>7</td><td>PF0</td></tr>
<tr><td>7</td><td>PF0 (ADC0)</td></tr>
<tr><td>8</td><td>PF1</td></tr>
<tr><td>8</td><td>PF1 (ADC1)</td></tr>
<tr><td>9</td><td>PF4</td></tr>
<tr><td>9</td><td>PF4 (ADC4 / TCK)</td></tr>
<tr><td>10</td><td>PF5</td></tr>
<tr><td>10</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>11</td><td>PF6</td></tr>
<tr><td>11</td><td>PF6 (ADC6 / TDO)</td></tr>
<tr><td>12</td><td>PF7</td></tr>
<tr><td>12</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>13</td><td>PF1</td></tr>
<tr><td>13</td><td>PF1 (ADC1)</td></tr>
<tr><td>14</td><td>NC</td></tr>
<tr><td>14</td><td>NC</td></tr>
<tr><td>15</td><td>PF5</td></tr>
<tr><td>15</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>PF7</td></tr>
<tr><td>17</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>18</td><td>AREF</td></tr>
<tr><td>18</td><td>AREF</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>19</td><td>VCC</td></tr>
Line 64: Line 78:
* led4 is connected to PE2
* led4 is connected to PE2


== programming ==
== Jumper settings ==

<table border=1>
<tr><td></td><td>J1</td><td>J2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.<br>
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.
This section describes how you get your program into the processor.
Line 104: Line 129:
Apparently the FLIP program is now available for Linux too. See below.
Apparently the FLIP program is now available for Linux too. See below.


=== windows ===
=== Windows ===


Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886


== writing programs ==
== Writing programs ==


The chip is an ATmega32U4. http://www.atmel.com/dyn/resources/prod_documents/doc7766.pdf
The chip is an ATmega32U4. http://www.atmel.com/dyn/resources/prod_documents/doc7766.pdf
Line 122: Line 147:
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
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 ==
== Future hardware enhancements ==


* Make an I2C header
* allow external reset by providing a header parallel to the onboard switch.
* Make an ICSP connector.
* Allow the board to work as ICSP programmer through the ICSP connector.


== future software enhancements ==
== Future software enhancements ==


* program the LUFA bootloader.
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
* 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

Latest revision as of 15:48, 21 December 2015

USB IO

This is the documentation page for the USB bigmultio PCB.

The USB bigMultio PCB can be bought in the BitWizard shop.

Overview

The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.

Assembly instructions

External resources

Datasheets

Additional software

Related projects

Pinout

20 Pin connector SV1 is connected as follows

1GND
2GND
3PB0 (SS / PCINT0)
4PB1 (PCINT1 / SCLK)
5PB2 (PDI / PCINT2 / MOSI)
6PB3 (PDO / PCINT3 / MISO)
7PB4 (PCINT4 / ADC11)
8PB5 (PCINT5 / OC1A / /OC4B / ADC12)
9PB6 (PCINT6 / OC1B / OC4B / ADC13)
10PB7 (PCINT7 / OC0A / OC1C / /RTS)
11PD0 (OC0B / SCL / INT0)
12PD1 (SDA / INT1)
13PD2 (RXD1 / INT2)
14PD3 (TXD1 / INT3)
15PD4 (ICP1 / ADC8)
16PD5 (XCK1 / /CTS)
17PD6 (T1 / /OC4D / ADC9)
18PD7 (T0 / OC4D / ADC10)
19VCC
20VCC

20 Pin connector SV2 is connected as follows

1GND
2GND
3PC6 (OC3A / /OC4A)
4PC7 (ICP3 / CLK0 / OC4A)
5PE2 (/HWB)
6PE6 (INT6 / AIN0)
7PF0 (ADC0)
8PF1 (ADC1)
9PF4 (ADC4 / TCK)
10PF5 (ADC5 / TMS)
11PF6 (ADC6 / TDO)
12PF7 (ADC7 / TDI)
13PF1 (ADC1)
14NC
15PF5 (ADC5 / TMS)
16NC
17PF7 (ADC7 / TDI)
18AREF
19VCC
20VCC
  • led1 is connected to VCC
  • led2 is connected to PF6
  • led3 is connected to PF7
  • led4 is connected to PE2

Jumper settings

J1J2IC1
5V10NOT mounted
3V3 <50mA01NOT mounted
3V3 >50mA00mounted

0 Means open, 1 means bridged.
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