dwelch67
Posts: 966
Joined: Sat May 26, 2012 5:32 pm

Bare Metal UART and JTAG

Thu Feb 06, 2014 4:49 am

So I recently purchased a (some) FT4232H Mini Module(s) from the FTDI folks (via Mouser). Not sure how long they have been around in this form, but it is new to me...The FT2232H should work just as well but they were sold out at the time. I added more ramblings to my armjtag README

https://github.com/dwelch67/raspberrypi ... r/armjtag

On this topic. Basically the FT2232 is extremely popular on microcontroller boards, fpga/cpld boards, and so on. It has two smart modules if you will per board that can each be uart, jtag, spi. For microcontroller board you often find one as jtag and the other as uart. The FT4232 differs from the 2232 in that there are still only two smart modules, but four total uarts, so you can have jtag and three uarts or jtag, spi and two uarts, etc. I used one as jtag and the next as uart so that it resembles the FT2232 capabilities.

Once you try it you will find that jtag is very nice for bare metal development, the H parts FT2232H and FT4232H are 30Mbps which puts them up with the multi thousand dollar jtag boxes as far as speed (those boxes have other features of course). I have not pushed the raspberry pi to see how fast its jtag can go...

So one $30 board (plus shipping, plus some jumper wires) gets you jtag and uart. I have been looking for a sub $50 jtag solution to share, the uart is just an added bonus.

The negative side to this Broadcom part used on the Raspberry PI or at least the way it is presented to us, is the ARM jtag debut tap is not exposed by default. You have to change some registers in the part to expose the jtag pins. The nice Raspberry Pi folks did move one pin over to P1 that was on another harder to use connector for the rev 2 board, thank you very much! Much easier for those who dont want to solder to do this stuff. My armjtag example is a small example that changes the registers to make the ARM jtag pins visible to the P1 connector.

No, I do not work for FTDI...I dont work for ARM, I dont work for Broadcom.

David

No...I didnt finish playing with the XMOS board, been too lazy. Want to play with spi on the raspberry pi, then implement something on the xmos to connect to that and go from there.

findx
Posts: 29
Joined: Mon Jul 29, 2013 7:52 pm

Re: Bare Metal UART and JTAG

Fri Feb 07, 2014 4:18 am

I'm not sure if it helps, but here's another RPi JTAG reference with schematics / code for the FT2232:

http://www.zavyalov.com/raspberry-pi/enable-jtag

DLP Design's low cost FTDI offerings might also be worth looking at too:

http://www.dlpdesign.com/usb/

I did some SPI work five years ago with their FT2232D board, and I was pretty happy with it. I haven't tried using that board for JTAG yet, however. I might add that FTDI provides a huge array of example code for their chips, including somewhat esoteric stuff like an MPSSE SPI driver for LabVIEW:

http://www.ftdichip.com/Support/Softwar ... abVIEW.htm

dwelch67
Posts: 966
Joined: Sat May 26, 2012 5:32 pm

Re: Bare Metal UART and JTAG

Mon Feb 10, 2014 3:11 pm

Dug out a pair of UM232H boards which I had not done much with, had not dug into mpsse enough, etc. And it works just fine as jtag as well. About $20, but it is only one channel, you cant do jtag and uart, so if you have a uart already then this will give you the jtag. The bothersome thing that makes it not worth being 2/3rds cheaper than an FT2232H or FT4232H board is the pins, I know they are out there, but it doesnt use the same size pin, so it wont stay attached to the jumpers I use and I suspect some or all sockets made for the larger pins. I spent a fair amount of time removing the plastic then extracting each pin one at a time then cleaning out the holes and putting in the headers I prefer. If you dont have the tools or the practice you might trash the board. Bending the pins a little might have just done the trick...

A little easier to wire up because AD0,AD1,AD2.. are all in a row and labelled, no need to count pins. 2,4,6,8...1,3,5,7,...

the mouser part number 895-VA800A-SPI looks even better, an FT232H for $18, with a better looking connector. The four signals we care about AD0-AD3 are brought out as SPI, but those are the same jtag pins.

dlp has the USB1232H board a few bucks cheaper than the board you pointed at. with the shipping from these parts vendors, every dollar counts. adding another 30-50% to the price of the item sucks. I generally buy a few if I have to go through mouser or digikey, etc...

Return to “Bare metal, Assembly language”