Difference between revisions of "FTDI ATmega"

From BitWizard Wiki
Jump to navigation Jump to search
(changed the introduction for readability.)
 
(21 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/shop/avr-boards/avr-dev-board-70 Bitwizard Catalog].




Line 12: Line 12:
=== Related projects ===
=== Related projects ===


* [[Temperature_control]]
== pinout ==

== Pinout ==


The 20 pin connector is connected as follows
The 20 pin connector is connected as follows


<table border=1>
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
</table>


Line 49: Line 41:
When using the Arduino IDE, the layout of the header is as follows:
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>1</td><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td></td><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td></td><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td></td><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td></td><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td></td><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td></td><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td></td><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td></td><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
<tr><td></td><td>V+</td><td>V+</td><td>20</td></tr>
</table>
</table>
<ul>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
</ul>

Note that the FTDI_ATmega runs at 20MHz, and the arduino runs at 16MHz. It should be possible to tell the arduino environment that your chip runs at 20MHz, as some people run their arduino at 20MHz.

See: [[Modifying the arduino IDE for 20MHz]] for more tricks needed to run the arduino environment at 20mHz.


== Jumper settings ==
== Jumper settings ==


SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
SV1 (next to the AVR): ICSP-Enable.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
Line 75: Line 71:
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator. (officially only up to 8MHz!)<br>


SJ1 (between the FTDI and the place for the regulator).
== programming ==
When you bridge this, the board becomes more "arduino compatible". The AVR will reset when you connect to the serial port. On arduino this is used to get the AVR into the bootloader.

SJ2 (between the crystal and the AVR)
This allows the AVR to run off a clock generated from the FTDI. Not really useful if you already have the crystal installed. And the FTDI can't generate 20MHz.

== Use as a programmer ==

The ftdi_atmega can be used as a programmer for ICSP programming other Atmel processors.

You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/software/avrusb500/

The avrusb500 is open source written by tuxgraphics http://tuxgraphics.org/electronics/200510/article05101.shtml

== Programming ==


This section describes how you get your program into the processor.
This section describes how you get your program into the processor.
Line 85: Line 95:
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).


Or you can program it with the ftdi bitbang programmer included on the board.
Or you can program it with the ftdi bitbang programmer included on the board. In that case, the jumper SV1 does not play a role.

==== The Arduino way ====


Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
Line 95: Line 107:
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.


==== The "normal" way ====
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.

As an example, we will use the "demo_lcd" program, which is available at [[http://www.bitwizard.nl/software the bitwizard software download directory]].
Download the .zip file, extract it, and cd to the demo_lcd directory. Now, type
make load
And you're done!


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


See the linux section above.
See the linux section above.


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


The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf


== future hardware enhancements ==
== Future hardware enhancements ==


Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
* Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(


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


* Add a reset button
* Add a reset button
Line 119: Line 136:
* Added SJ for arduino compatibility.
* Added SJ for arduino compatibility.


=== b7.0 ===
=== 7.0 ===
* Initial public release
* Initial public release



Latest revision as of 12:12, 2 November 2015

FTDI-atmega Development Board
FTDI-atmega Development Board

The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the Bitwizard Catalog.


External resources

Datasheets

Related projects

Pinout

The 20 pin connector is connected as follows

GNDGND
PC3PC2
PC1PC0
PB5PB4
PB3PB2
PB1PB0
PD7PD6
PD5PD4
PD3PD2
VCCVCC

LEDs

  • led1 is connected to VCC (the top one, called led2 on V7.0)
  • led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
  • led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
  • led4 is connected to PC4
  • led5 is connected to PC5

Arduino Pinout

When using the Arduino IDE, the layout of the header is as follows:

1GNDGND
A3A2
A1A0
1312
1110
98
76
54
32
V+V+20
  • Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.
  • Pin 0 and 1 are used for the COM interface just like a regular arduino.
  • Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.

Note that the FTDI_ATmega runs at 20MHz, and the arduino runs at 16MHz. It should be possible to tell the arduino environment that your chip runs at 20MHz, as some people run their arduino at 20MHz.

See: Modifying the arduino IDE for 20MHz for more tricks needed to run the arduino environment at 20mHz.

Jumper settings

SV1 (next to the AVR): ICSP-Enable.
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)

SV4 (next to the LEDs): Power supply selection.
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.
1-2: Runs on 5V from USB
2-3: Runs on 3V3 from the FTDI chips internal regulator. (officially only up to 8MHz!)

SJ1 (between the FTDI and the place for the regulator). When you bridge this, the board becomes more "arduino compatible". The AVR will reset when you connect to the serial port. On arduino this is used to get the AVR into the bootloader.

SJ2 (between the crystal and the AVR) This allows the AVR to run off a clock generated from the FTDI. Not really useful if you already have the crystal installed. And the FTDI can't generate 20MHz.

Use as a programmer

The ftdi_atmega can be used as a programmer for ICSP programming other Atmel processors.

You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/software/avrusb500/

The avrusb500 is open source written by tuxgraphics http://tuxgraphics.org/electronics/200510/article05101.shtml

Programming

This section describes how you get your program into the processor.

Linux

You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).

Or you can program it with the ftdi bitbang programmer included on the board. In that case, the jumper SV1 does not play a role.

The Arduino way

Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html

The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.

In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.

A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.

The "normal" way

As an example, we will use the "demo_lcd" program, which is available at [the bitwizard software download directory]. Download the .zip file, extract it, and cd to the demo_lcd directory. Now, type

make load

And you're done!

Windows

See the linux section above.

Writing programs

The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf

Future hardware enhancements

  • Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(

Future software enhancements

  • Add a reset button

Changelog

7.1

  • Added decoupling capacitor for FTDI 3.3
  • Added SJ for arduino compatibility.

7.0

  • Initial public release

Media

FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.