Tiny Programmer as UART?


Hello all

I wonder if the TinyProgrammer for the A series can be used as USB to serial adapter, after programming the bitstream.
You will need a UART IP in the MachXO2 that connects to RX/TX of the PIC, but I’m not sure if the CDC modifications for JTAG still allow simple byte transfer with JTAG disabled.

Thanks in advance


It doesn’t currently support UART. However, it’s not hard-coded for JTAG. It runs a firmware that allows bitbanged input/output over USB as well as some accelerated serial operations. You could take a look at tinyfpgaa.py and see how you can use the code to implement your own communication protocol. Something like SPI would work well as the programmer supports accelerated serial input and output with a dedicated clock and data pins.

Just make sure you use the JTAGEN pin to disable JTAG after you program the bitstream.


Thank you

It was easier for me to study the C code of the PIC than the Python Application :wink:
I see it’s very flexible, I think I can also use RC0 and RC1 pins of the PIC to send some Data per SPI.
There is quite a bit of overhead to send single bytes with the command 0x18, but at the moment I anyway only need to send large packets from PC to FPGA.

Can the Python application also be used for bigger MachXO2/3 devices and other Lattice FPGAs with JTAG (ECP5 for example) ?



When I was developing the TinyFPGA Programmer and the tinyfpgaa.py module I started out by having it playback JTAG SVF files. In fact, the code is still there in the JtagSvfParser class. I haven’t used that class in a while, so it might not be 100% working currently. However, if you want to try and program something other than a MachXO2 FPGA, you may be able to generate an SVF file for it and play it back using the tinyfpgaa.JtagSvfParser class. It won’t be plug-and-play though.

As for larger MachXO2 parts than the 1200 in the A2…it might just work. I haven’t tried it.