AVReAl and MPSSE
Some of FTDI USB converter chips have MPSSE — hardware engine for implementation of serial interfaces like JTAG, SPI, I2C. FT2232D and previous versions FT2232C, FT2232L support Full-Bandwidth USB and have upper TCK/SCK frequency level 6 MHz. FT2232H, FT4232H, FT232H work in USB 2.0 Hi-Speed mode and have 30 MHz limit.
MPSSE defines DBUS0..DBUS2 as TCK/SCK, TDI/MOSI and TDO/MISO. AVR ISP interface requires RESET signal. DBUS3 (TMS/CS) can be used for this purpose and AVReAl uses it by default.
It is not mandatory to use a special programmer (like Turtelizer or Olimex ARM-USB-OCD) with AVReAl. One of simple evaluation boards is enough:
- FT2232H Mini Module
- FT4232H Mini Module
- USB Hi-Speed to MPSSE cable (FT232H)
- DLP-2232M
- Simple circuit with FT2232 on prototyping board
Switches are as simple as hardware in use:
The name ft2232
in switch -a is suitable for FT2232C, FT2232L, FT2232D.
Change it to appropriate value for FT2232H, FT4232H, FT232H.
-az switch is used because simple boards do not contain any buffers. AVReAl will set SPI and RESET pins to input mode and thus FTDI chip will be disconnected from the microcontroller. Be aware that inputs will be pulled to VCCIO line with FTDI chip weak internal pull-ups. Also pay your attention to output current limit. For instance, FT2232D in default mode has 0.5 V logic ‘0’ level at 2 mA load curent and 3.3 V VCCIO supply. It means that FT2232D output driver might not provide required ‘0’ level with 1 k external pull-up on RESET line. Enable “High current I/O” mode in configuration EEPROM.
If default description of the device in configuration EEPROM (for example, “Dual RS232” for FT2232C/L/D) is not changed, -p “port” switch may not be used.
Two MPSSE-capable channels give possibility to connect two microcontroller boards and to select one, which will be programmed, by -p
switch. Someone can run even two AVReAls and program two microcontrollers simultaneously. Programming speed will not be affected because throughput of USB 2.0 Hi-Speed is sufficient.
Switches for B
channel of FT2232H without EPROM or with empty EEPROM are shown below. If the device attribute (description or serial number) contains spaces, the attribute or the whole switch must be quoted:
-aft2232h -az "-pd=Dual RS232-HS B"
You can get a list of connected FTDI devices with their descriptions and serial numbers by using following switches:
AVReAl supports adapter pin remapping in a configuration file or a command line. If it is required RESET line can be mapped to any pin that is able to be controlled in MPSSE mode. Let ADBUS7 is used for RESET. Then -a
switch looks like:
-aft4232h:reset=dbus7
If RESET line is inverted (for instance, by transistor), sign ~
is used before the signal name. As mentioned above, MPSSE fixes SPI signals to specific pins. So the signals can not be remapped to another pins though inversion can be added. Let all interface lines including MISO are inverted by 74HC04. In addition, RESET is connected to ACBUS3. In this case -a
switch looks like:
-aft4232h:sck=~dbus0:mosi=~dbus1:miso=~dbus2:reset=~cbus3
You also can create a configuration file named, for example adapter.cfg
:
mosi = ~adbus1
miso = ~adbus2
reset = ~acbus3
and use another form of the switch:
To work in Linux with FTDI-based programmers without root priveleges add udev rules for used adapter. Read more in AVReAl/Linux and root privileges
MPSSE engine gives a possibility to reach easily high clocking speed of JTAG and SPI. That’s why there are many microcontroller programming adapters based on MPSSE-capable FTDI chips. The adapters are intended mainly for ARM microcontrollers programming and debugging via JTAG. Although all of them can be used for AVR programming in Low Voltage ISP mode via SPI.
Most adapters have buffers or level translators, LED indicators. Unfortunately, in different adapters these resources are controlled by different pins.
Adapter reviews with recommendations and configuration file samples will be made in future posts in AVReAl » Adapters and Drivers » USB-FTDI category.
Программа AVREAL умеет работать по интерфейсу JTAG, с микроконтроллерами AVR, через программатор на FT2232H ?