Skip to main content
Inlined a couple of links with the article titles
Source Link
Greenonline
  • 3.2k
  • 7
  • 37
  • 49

It appears that header is used for "Synchronous Bit Bang mode" as documented here:

   http://www.ftdichip.com/Support/Documents/AppNotes/AN_232RBit Bang Modes For The FT232R and FT245R (Application Note AN_232R-01_Bit_Bang_Mode_Available_For_FT232R_and_Ft245R01, Document Reference No.pdf: FT_000339)

You can in fact configure that header to be an SPI programmer, as described for example, in hereFT232R Bitbang Programmer.

The mapping of pins to numbers works like this  ... From the PDFPDF about bit bang mode mentioned above we have this table, with annotations in blue by me:

The numbers refer to the bit number (iei.e. in the range 0 to 7) in the "bit banged" data byte. We can see from the earlier schematic that, for example, MISO on the ICSP header is wired to CTS on the FT232RL. Thus MISO is data bit 3, which we tell avrdude in the above configuration. Similarly SCK is data bit 5, and so on.

I had mine plugged into an Atmega328PATmega328P.

It appears that header is used for "Synchronous Bit Bang mode" as documented here:

 http://www.ftdichip.com/Support/Documents/AppNotes/AN_232R-01_Bit_Bang_Mode_Available_For_FT232R_and_Ft245R.pdf

You can in fact configure that header to be an SPI programmer, as described for example, here.

The mapping of pins to numbers works like this  ... From the PDF about bit bang mode mentioned above we have this table, with annotations in blue by me:

The numbers refer to the bit number (ie. in the range 0 to 7) in the "bit banged" data byte. We can see from the earlier schematic that, for example, MISO on the ICSP header is wired to CTS on the FT232RL. Thus MISO is data bit 3, which we tell avrdude in the above configuration. Similarly SCK is data bit 5, and so on.

I had mine plugged into an Atmega328P.

It appears that header is used for "Synchronous Bit Bang mode" as documented here:  Bit Bang Modes For The FT232R and FT245R (Application Note AN_232R-01, Document Reference No.: FT_000339)

You can in fact configure that header to be an SPI programmer, as described for example, in FT232R Bitbang Programmer.

The mapping of pins to numbers works like this... From the PDF about bit bang mode mentioned above we have this table, with annotations in blue by me:

The numbers refer to the bit number (i.e. in the range 0 to 7) in the "bit banged" data byte. We can see from the earlier schematic that, for example, MISO on the ICSP header is wired to CTS on the FT232RL. Thus MISO is data bit 3, which we tell avrdude in the above configuration. Similarly SCK is data bit 5, and so on.

I had mine plugged into an ATmega328P.

Grammar.
Source Link
Nick Gammon
  • 38.9k
  • 13
  • 70
  • 126

It appears that header is that it is used for "Synchronous Bit Bang mode" as documented here:

I had mine plugged into an Atmega328P.


Example connected to a Diavolino

Programming an Atmega328P

Once we have got this far you just connect the FTDI board to your target board with a straight-through cable.

It appears that header is that it is used for "Synchronous Bit Bang mode" as documented here:

I had mine plugged into an Atmega328P.

It appears that header is used for "Synchronous Bit Bang mode" as documented here:

I had mine plugged into an Atmega328P.


Example connected to a Diavolino

Programming an Atmega328P

Once we have got this far you just connect the FTDI board to your target board with a straight-through cable.

Added more explanations.
Source Link
Nick Gammon
  • 38.9k
  • 13
  • 70
  • 126

I found a photo of the back of the board. Flipped over so you can read it better it looks like this:

Back of FTDI board

The FT232RL chip on the board doesn't have SPI inputs (eg. MOSI/MISO/SCK) so the header cannot be for that.

I found a schematic (below) which is not for that board, however the header pins are labelled the same as you found, so it is plausibly similar. I added the data direction arrows myself based on the FT232 datasheet. It clearly cannot be an ICSP programming header because they are all inputs (however, see below).

FT232 board schematicFTDI board schematic

The best explanation I can make forIt appears that header is that it is used for "Synchronous Bit Bang mode" however that seems to require 8 signals (plus Gnd and Vcc) so that isn't totally convincing. However as documented in the PDF, in that mode the pins can be configured as input/output.here:

After more searching, it appears that youYou can in fact configure that header to be an SPI programmer, as described for example, here.

 

As described onI made up a test as I had a similar board in my parts drawer:

FTDI board front

It had provision for a 6-pin header similar to yours. Turning the board over we can see that pagethey were labelled exactly the same as yours:

FTDI board back

I soldered on a header (in yellow, to be consistent) giving me this:

FTDI board with header

I added a white dot to indicate pin 1 (visible on the edge) so I plug the cable in the right way around.


When I attempted to use the board I got this message from avrdude:

avrdude: error: no libftdi or libusb support. Install libftdi1/libusb-1.0 or libftdi/libusb and run configure/make again

So, it had to be compiled from scratch! I am using Ubuntu 14.04 if you editare trying to follow along. :)


Download avrdude

Go to the site http://www.nongnu.org/avrdude/

I downloaded version 6.3 source: http://download.savannah.gnu.org/releases/avrdude/avrdude-6.3.tar.gz

Install libusb and libftdi

Before compiling I had to grab libusb and libftdi:

sudo apt-get install libusb-1.0-0-dev
sudo apt-get install libftdi-dev

Compile avrdude

Now we make avrdude after extracting the archive and navigating to its folder:

./configure --enable-libusb --enable-libftdi
make

Find correct configuration

Inside the avrdude.conf and add something likefile which comes with avrdude I found (after some pondering) this seems to be the correct entry:

# see http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
# Note: pins are numbered from 1!
programmer
  id    = "ftdi";"arduino-ft232r";
  desc  = "FT232R"Arduino: BitBangFT232R Programmer";connected to ISP";
  type  = ft245r;"ftdi_syncbb";
  connection_type = usb;
  miso  = 5;3;  # DSRCTS X3(1)
  sck   = 4;5;  # DTRDSR X3(2)
  mosi  = 6;  # DCD X3(3)
  reset = 7;  # RI  X3(4)
;

Now it canThe mapping of pins to numbers works like this ... From the PDF about bit bang mode mentioned above we have this table, with annotations in blue by me:

Bit bang mode pins

The numbers refer to the bit number (apparentlyie. in the range 0 to 7) "bitbang" out your programming signalsin the "bit banged" data byte. We can see from the earlier schematic that, lettingfor example, MISO on the ICSP header is wired to CTS on the FT232RL. Thus MISO is data bit 3, which we tell avrdude in the above configuration. Similarly SCK is data bit 5, and so on.

I attempted to test like this:

./avrdude -C avrdude.conf -carduino-ft232r -pm328p  -v

Fix permissions

I got a permissions error which was fixed by creating a file in the folder /etc/udev/rules.d/ called 71-FTDI.rules. Inside this is:

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE:="0666"

The numbers may vary for your board. You need to find the vendor and product ID. In Ubuntu you program another chip viacan do lsusb and see (amongst other things):

Bus 003 Device 061: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC
                       ^^^^ ^^^^

Note the two hex numbers, which get copied into the rules file.

After doing that, tell the system to reload the rules:

sudo udevadm control --reload-rules

Then unplug and replug the FTDI breakout board to get it to notice the new permissions.

Test board detection

I don't understand how that worksFinally, butthe avrdude must setline above works and reads the FT232 chip:

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: safemode: hfuse reads as DE
avrdude: safemode: efuse reads as FD

avrdude: safemode: hfuse reads as DE
avrdude: safemode: efuse reads as FD
avrdude: safemode: Fuses OK (E:FD, H:DE, L:FF)

avrdude done.  Thank you.

I had mine plugged into bitbang mode by a special command sequence, reconfiguringan Atmega328P.


Summary

The FTDI board you have (and the pins, so that itone I have) can then be used as a ICSP programmer for the AVR chips, as described above. Thus a simple board can be both a USB to serial converter, and also an ICSP programmer.

I see similar boards selling on eBay for around $5 so that is probably quite a cheap programming option.

I found a photo of the back of the board. Flipped over so you can read it better it looks like this:

Back of FTDI board

The FT232RL chip on the board doesn't have SPI inputs (eg. MOSI/MISO/SCK) so the header cannot be for that.

I found a schematic (below) which is not for that board, however the header pins are labelled the same as you found, so it is plausibly similar. I added the data direction arrows myself based on the FT232 datasheet. It clearly cannot be an ICSP programming header because they are all inputs (however, see below).

FT232 board schematic

The best explanation I can make for that header is that it is used for "Synchronous Bit Bang mode" however that seems to require 8 signals (plus Gnd and Vcc) so that isn't totally convincing. However as documented in the PDF, in that mode the pins can be configured as input/output.

After more searching, it appears that you can in fact configure that header to be an SPI programmer, as described for example, here.

As described on that page, if you edit avrdude.conf and add something like this:

programmer
  id    = "ftdi";
  desc  = "FT232R BitBang Programmer";
  type  = ft245r;
  miso  = 5; # DSR
  sck   = 4; # DTR
  mosi  = 6; # DCD
  reset = 7; # RI
;

Now it can (apparently) "bitbang" out your programming signals, letting you program another chip via the FTDI breakout board.

I don't understand how that works, but avrdude must set the FT232 chip into bitbang mode by a special command sequence, reconfiguring the pins, so that it can then be used as a ICSP programmer.

I found a schematic (below) which is not for that board, however the header pins are labelled the same as you found, so it is plausibly similar.

FTDI board schematic

It appears that header is that it is used for "Synchronous Bit Bang mode" as documented here:

You can in fact configure that header to be an SPI programmer, as described for example, here.

 

I made up a test as I had a similar board in my parts drawer:

FTDI board front

It had provision for a 6-pin header similar to yours. Turning the board over we can see that they were labelled exactly the same as yours:

FTDI board back

I soldered on a header (in yellow, to be consistent) giving me this:

FTDI board with header

I added a white dot to indicate pin 1 (visible on the edge) so I plug the cable in the right way around.


When I attempted to use the board I got this message from avrdude:

avrdude: error: no libftdi or libusb support. Install libftdi1/libusb-1.0 or libftdi/libusb and run configure/make again

So, it had to be compiled from scratch! I am using Ubuntu 14.04 if you are trying to follow along. :)


Download avrdude

Go to the site http://www.nongnu.org/avrdude/

I downloaded version 6.3 source: http://download.savannah.gnu.org/releases/avrdude/avrdude-6.3.tar.gz

Install libusb and libftdi

Before compiling I had to grab libusb and libftdi:

sudo apt-get install libusb-1.0-0-dev
sudo apt-get install libftdi-dev

Compile avrdude

Now we make avrdude after extracting the archive and navigating to its folder:

./configure --enable-libusb --enable-libftdi
make

Find correct configuration

Inside the avrdude.conf file which comes with avrdude I found (after some pondering) this seems to be the correct entry:

# see http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
# Note: pins are numbered from 1!
programmer
  id    = "arduino-ft232r";
  desc  = "Arduino: FT232R connected to ISP";
  type  = "ftdi_syncbb";
  connection_type = usb;
  miso  = 3;  # CTS X3(1)
  sck   = 5;  # DSR X3(2)
  mosi  = 6;  # DCD X3(3)
  reset = 7;  # RI  X3(4)
;

The mapping of pins to numbers works like this ... From the PDF about bit bang mode mentioned above we have this table, with annotations in blue by me:

Bit bang mode pins

The numbers refer to the bit number (ie. in the range 0 to 7) in the "bit banged" data byte. We can see from the earlier schematic that, for example, MISO on the ICSP header is wired to CTS on the FT232RL. Thus MISO is data bit 3, which we tell avrdude in the above configuration. Similarly SCK is data bit 5, and so on.

I attempted to test like this:

./avrdude -C avrdude.conf -carduino-ft232r -pm328p  -v

Fix permissions

I got a permissions error which was fixed by creating a file in the folder /etc/udev/rules.d/ called 71-FTDI.rules. Inside this is:

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE:="0666"

The numbers may vary for your board. You need to find the vendor and product ID. In Ubuntu you can do lsusb and see (amongst other things):

Bus 003 Device 061: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC
                       ^^^^ ^^^^

Note the two hex numbers, which get copied into the rules file.

After doing that, tell the system to reload the rules:

sudo udevadm control --reload-rules

Then unplug and replug the FTDI board to get it to notice the new permissions.

Test board detection

Finally, the avrdude line above works and reads the chip:

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: safemode: hfuse reads as DE
avrdude: safemode: efuse reads as FD

avrdude: safemode: hfuse reads as DE
avrdude: safemode: efuse reads as FD
avrdude: safemode: Fuses OK (E:FD, H:DE, L:FF)

avrdude done.  Thank you.

I had mine plugged into an Atmega328P.


Summary

The FTDI board you have (and the one I have) can be used as a ICSP programmer for the AVR chips, as described above. Thus a simple board can be both a USB to serial converter, and also an ICSP programmer.

I see similar boards selling on eBay for around $5 so that is probably quite a cheap programming option.

Source Link
Nick Gammon
  • 38.9k
  • 13
  • 70
  • 126
Loading