Electronics > FPGA

RS-232 on ice40 UP5k

(1/2) > >>

fmahnke:
Hi, first time poster and a relative newcomer to FPGAs.

I have an ice40 up5k breakout board and would like to do RS-232 over the USB cable. This was easy on my icestick, which dedicates one of the FTDI's interfaces to RS-232 pins. I'm stumped getting it to work on my up5k board. Does anyone have this board that's done this or could lend a hand?

Looking at the UP5k board, schematic, I see interface A's TX/RX pins are connected to the SPI pins SCK and SI. So I thought if I'm not using SPI, I can use those pins for my serial communication.

I shunted the programming shunts vertically and removed the J7 shunt to disable flash.

Then I wrote my verilog code with SCK as the rx pin and SI as the tx pin. I synthesized and programmed the board with yosys/nextpnr, and I verified the board is transmitting data by probing the SI pin.

On the computer side, I see no incoming data on the /dev/ttyUSB? device exposed from the FTDI driver. Nor do I see the board receiving data when I send it from the computer. I also tried to connect to the device with a C program using libftdi. I connect to the FTDI device successfully, but again, no data going back and forth.

I connected the SCK/SI pins to another DB-9/USB cable with an internal FTDI device, and when I do that, I see data going over the line, so I think the verilog implementation is not the problem.

Any ideas? Thank you.

imo:
The issue could be:
1. wrong baudrate set (doublecheck your verilog and FTDI setting)
2. the USB/serial dongle could be working with 5V I/O, your U5k is always 3.3V I/O
3. Rx/Tx wires messed up - I always put 470-1k resistors in series with Rx and Tx lines - it helps in case of issue n.2 above..

fmahnke:
Hi, thanks for your suggestions. I think I have already checked all those things pretty thoroughly.

I'm not sure if it was very clear from my initial message. Using the pins I mentioned works when I do the test breaking out the pins to a separate DB-9 to USB cable with FTDI chip. The failing test is when I try to use the board's _onboard_ FTDI chip through its onboard USB connector (same cable used to program the device).

Using an SPI core with the FTDI in MPSSE mode does work, so that's how I'm proceeding for now. It's a bit more difficult/unnecessary to use SPI for the communication I'm doing, but that's what is working, so I'll make it work for the moment.

SiliconWizard:

--- Quote from: fmahnke on July 26, 2021, 01:52:28 pm ---Hi, thanks for your suggestions. I think I have already checked all those things pretty thoroughly.

I'm not sure if it was very clear from my initial message. Using the pins I mentioned works when I do the test breaking out the pins to a separate DB-9 to USB cable with FTDI chip. The failing test is when I try to use the board's _onboard_ FTDI chip through its onboard USB connector (same cable used to program the device).

Using an SPI core with the FTDI in MPSSE mode does work, so that's how I'm proceeding for now. It's a bit more difficult/unnecessary to use SPI for the communication I'm doing, but that's what is working, so I'll make it work for the moment.

--- End quote ---

What exactly is the FTDI part on this board?

imo:
Provided you are using UPduino with the onboard FTDI 232H - they use the 232H's SPI signals (in order to program the on-board flash mem). It will not work as "uart", however. I wrote a post about that years back..

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version