Communicate (FDTI- TTL) UART (Without MAX232 Chip) directly with ARM MCU

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
karthickefy
Posts: 74
Joined: Thu Nov 30, 2017 3:21 am
Has thanked: 4 times
Been thanked: 9 times
Contact:

Communicate (FDTI- TTL) UART (Without MAX232 Chip) directly with ARM MCU

Post by karthickefy »

Hi LeighM,
Thank you very much for your fast reply. Now I changed into the new topic. :D Also, I need another help. How to communicate the ARM MCU's UART port component directly through FDTI TTL UART adaptor (without using MAX232 IC)? I have tried to communicate but FDTI receives wrong Data. If MCU sends string "1" computer received 0A in Hex. Please guide me on how to communicate the MCU directly without any inverter IC(MAX232).

In our product, there is no Max232 inverter IC circuit populated and our product FW directly communicates through UART (TTL) through FDTI chip. For testing the ADC value (I will develop the FW through Flowcode and communicate through FDTI), I need to use the same TTL method in our Functional Tester.

Thanks in advance.

Karthick
Attachments
uart.PNG
uart.PNG (965.78 KiB) Viewed 3475 times
test uart.fcfx
(10.1 KiB) Downloaded 129 times

Alkaline
Posts: 143
Joined: Mon Aug 20, 2018 11:04 am
Has thanked: 42 times
Been thanked: 41 times
Contact:

Re: Communicate (FDTI- TTL) UART (Without MAX232 Chip) directly with ARM MCU

Post by Alkaline »

Hi Karthick

I have used a stm32 + FTDI successfully. I use termite 3.4 software but I think anything else is fine

Check that the speed and settings of the com port are identical both on flowocode and on the program you use to communicate.

usually the ftdi cards allow to go both at 3.3v and at 5v. The voltage must be identical to that of the microcontroller

If the microcontroller uses a lower voltage, a level shifter will be necessary

karthickefy
Posts: 74
Joined: Thu Nov 30, 2017 3:21 am
Has thanked: 4 times
Been thanked: 9 times
Contact:

Re: Communicate (FDTI- TTL) UART (Without MAX232 Chip) directly with ARM MCU

Post by karthickefy »

Hi Alkaline,
Thanks. I also used Termite 3.4 and i get the junk characters. I 'm not getting what I expected. Can you please review the attached code and advice where I have made the mistake? I guess we need to invert the RX-TX signal through MAX232.

Now I just increase the count for every 500ms and I'm getting junk characters instead of digits. I'm using the STM Nucleo-F446ZE Discovery board with FDTI and communicate through Termite 3.4. Thanks.

Karthick
Attachments
test uart.fcfx
(9.92 KiB) Downloaded 136 times

karthickefy
Posts: 74
Joined: Thu Nov 30, 2017 3:21 am
Has thanked: 4 times
Been thanked: 9 times
Contact:

Re: Communicate (FDTI- TTL) UART (Without MAX232 Chip) directly with ARM MCU

Post by karthickefy »

Hi Alkaline/LeighM,
Attaches is the response from STM32 MCU's UART port. I get some junk characters instead of numerical data.

I have tried to build using USART2 port, but there is some error if I choose pre-configured USART or UART ports directly. If I choose software mode and I define the RX and TX pin manually then there is no error during compile. Below are some examples of pictures. Please help.

Karthick.
Attachments
test uart.fcfx
(9.9 KiB) Downloaded 134 times
Error if choose USART2 directly.PNG
Error if choose USART2 directly.PNG (238.04 KiB) Viewed 3459 times
UART response from MCU.PNG
UART response from MCU.PNG (191.41 KiB) Viewed 3459 times

Alkaline
Posts: 143
Joined: Mon Aug 20, 2018 11:04 am
Has thanked: 42 times
Been thanked: 41 times
Contact:

Re: Communicate (FDTI- TTL) UART (Without MAX232 Chip) directly with ARM MCU

Post by Alkaline »

Hi Karthick

i'm using the following hardware

MCU stm32f030RC

usb <-> uart LC234X

I modified the project to adapt it to my pcb and everything works perfectly even at different speeds 19200 and 115200

have you checked that the pins are connected correctly?
GND <-> GND
RX (MCU) <-> TX (FTDI)
TX (MCU) <-> RX (FTDI)
Attachments
uart_debug.jpg
uart_debug.jpg (47.71 KiB) Viewed 3454 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Communicate (FDTI- TTL) UART (Without MAX232 Chip) directly with ARM MCU

Post by LeighM »

I have tried to build using USART2 port, but there is some error if I choose pre-configured USART or UART ports directly.
In the attached project you had not selected the Rx/Tx pins? ...

UART.jpg
UART.jpg (34.5 KiB) Viewed 3452 times

karthickefy
Posts: 74
Joined: Thu Nov 30, 2017 3:21 am
Has thanked: 4 times
Been thanked: 9 times
Contact:

Re: Communicate (FDTI- TTL) UART (Without MAX232 Chip) directly with ARM MCU

Post by karthickefy »

HI LeighM,
Thanks Again. Yes, you are right. I forget to select the port. I thought when I select the Channel 2 -USART2, Flowcode define the pins automatically.
After defining the PD5 for Tx and PD6 for Rx and now working fine. But it is not working with software mode and manual define ports.

Thanks.
Karthick.
Attachments
WORKING.PNG
WORKING.PNG (225.64 KiB) Viewed 3451 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Communicate (FDTI- TTL) UART (Without MAX232 Chip) directly with ARM MCU

Post by LeighM »

Glad to hear you now have it working,
But it is not working with software mode and manual define ports.
Is the Flowcode project "clock" speed correct for the crystal on your hardware?
I noticed it is set to 16MHz

karthickefy
Posts: 74
Joined: Thu Nov 30, 2017 3:21 am
Has thanked: 4 times
Been thanked: 9 times
Contact:

Re: Communicate (FDTI- TTL) UART (Without MAX232 Chip) directly with ARM MCU

Post by karthickefy »

Actually there is no external OSC present in the STM32F446 Nucleo board. As per datasheet, the STM32F446ZET6 chip has the internal oscillator (Internal 16 MHz factory-trimmed RC (1% accuracy)) and that is 16Mhz. So I choose 16Mhz.

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Communicate (FDTI- TTL) UART (Without MAX232 Chip) directly with ARM MCU

Post by LeighM »

When you try software mode, do you get anything at all? or do you get garbage, i.e. wrong characters?
Software mode will only work (be accurate enough) at lower baud rates.

Post Reply