Page 1 of 2

UART Component - USB-UART FT232RL hardware

Posted: Mon Oct 18, 2021 6:30 am
by r_teixeir
Hi Team, Is it possible for the UART component to run the USB-UART hardware(FT232RL) in flowcode V8?

Thanks

Rod

UART component

Posted: Mon Oct 25, 2021 7:35 am
by r_teixeir
Hi everyone, by studying the examples in the wiki and the various components available, iam trying to simulate and download in hardware a simple example of echo, so I can move on to my project. Iam trying to code by using the component UART flowcode 8, and in hardware USB-UART and iam not getting good results.

Can somebody run tests for me please. I have the easyic and the easypic pro, it could be pic18F45k22, pic18F87j50 or 87k22.
The USB-Uart circuit schematic uses the FT232RL.

Thanks

Rod

Re: UART Component - USB-UART FT232RL hardware

Posted: Mon Oct 25, 2021 10:47 am
by medelec35
Hi Rod.
Does this work any better?

Re: UART Component - USB-UART FT232RL hardware

Posted: Mon Oct 25, 2021 11:47 am
by r_teixeir
Hi Medelec, thnx for replying. The result remains the same. Strange.

Rod

Re: UART Component - USB-UART FT232RL hardware

Posted: Mon Oct 25, 2021 11:55 am
by medelec35
Seems like hardware or UART might not be running at the correct speed?
Do you have a logic analyser or an oscilloscope?
If not have you made sure the one second flasher is running at the correct rate?

Re: UART Component - USB-UART FT232RL hardware

Posted: Mon Oct 25, 2021 12:03 pm
by r_teixeir
Hi Medlec Ive just ran a test with a hello world from mikroe's echo example
It is working fine.
Thanks

Rod

Re: UART Component - USB-UART FT232RL hardware

Posted: Mon Oct 25, 2021 12:29 pm
by medelec35
Yes, that suggests that Mikroe is controlling everything at the correct speed.
Flowcode may not, e.g. could be a configuration issue so the clock speed is wrong.
Or clock speed is correct and UART might be working at the wrong baud rate.
That's why I have asked about the one sec flash test and if you had a logic analyser or an oscilloscope.

Re: UART Component - USB-UART FT232RL hardware

Posted: Mon Oct 25, 2021 12:42 pm
by r_teixeir
Hi Medelc, here is the 1sec flasher. It seems right.

Thnx

Rod

Re: UART Component - USB-UART FT232RL hardware

Posted: Mon Oct 25, 2021 7:40 pm
by r_teixeir
Hi Medelec, what should we do for the next steps? This is only happenning for this component(USB-UART). So you know, I have the BL0032 (dsPic-16bits) I ran the USB-Serial and it worked perfectly. But as you know it is not a third party board and it is not an USB-Uart comm.
Should I reinstall the flowcode in C: Drive? I have a laptop with ssd not enough memory in C drive, so I installed in D: drive.
I had to transfer the updates (components) which are downloaded automatically in c drive Matrix file to D drive.
Right now all the flowcode versions 6, 7 e 8 are in D drive.

Thanks

Rod

Re: UART Component - USB-UART FT232RL hardware

Posted: Mon Oct 25, 2021 8:40 pm
by medelec35
Hi, Rod.
You are showing me the simulation, did you time the on /off times on your easypic pro?
I have a 18F46K22 so it's from the same family and that is echoing perfectly:
Echo Port.png
Echo Port.png (3.05 KiB) Viewed 8877 times
For the version I posted, you will need to add a calculation macro:
Calculation Box.png
Calculation Box.png (38.34 KiB) Viewed 8877 times
Are you running at least Flowcode V8.2.2.15?

Do you have an oscilloscope or logic analyser?

Re: UART Component - USB-UART FT232RL hardware

Posted: Mon Oct 25, 2021 11:00 pm
by r_teixeir
Hi Medelec, yes I do have an osciloscope and the previous picture also has the analog discovery of 1sec led flasher and its positive / negative edges.

Ill run the tests again about the comm again tonight and let you know about it.

Thanks

Rod

Re: UART Component - USB-UART FT232RL hardware

Posted: Mon Oct 25, 2021 11:17 pm
by medelec35
Hi Rod.
A tip I always use to determine the UART baud rate.
Send an ASCII U it must be upper case.
measure any single pulse width.
Baud = 1/singe pulse duration.
Can you let me know the result, please?

Re: UART Component - USB-UART FT232RL hardware

Posted: Tue Oct 26, 2021 3:45 am
by r_teixeir
Hi Medelec, I ran the tests using the another board easypic with pic18F45K22. The error remains the same as you can see by the pictures.
I was able to stablish comm with flowcode and the board but the data tx is not echoing the same message on the rx.

what is the next step?

Thanks again

Rod

Re: UART Component - USB-UART FT232RL hardware

Posted: Tue Oct 26, 2021 4:02 am
by r_teixeir
Hi Medelec, Ive just ran a test by changing the oscillator config to the same hello world from mikroe and it worked perfectly. I was able to stablish comm from flowcode to mikroe easy pic board. I wrote my name and tx and rx were the same messages that were trade between them and the logic analyser confirmed. One observation though, is that hexadecimal code generated was from the mikroe compiler and not from the flowcode compiler.
I tried to test again by coding using flowocode and the error remains.

So what now?

Thanks for the help

Rod

Re: UART Component - USB-UART FT232RL hardware

Posted: Tue Oct 26, 2021 4:17 am
by r_teixeir
Hi Medelec im getting error attached

thnx

Rod

Re: UART Component - USB-UART FT232RL hardware

Posted: Tue Oct 26, 2021 10:01 am
by medelec35
Looking at the image of the analyser the UART is way too slow.
Can you do two things.
1. Run the 1 sec flasher measure the pin on/ off duration. what is the value?
2. I can't see the single UART pulse duration from the image, what is the value?

How often does the crashing occur?

Re: UART Component - USB-UART FT232RL hardware

Posted: Tue Oct 26, 2021 11:11 am
by r_teixeir
Hi Medelec I wrote my name as one single hit and i got this.

Thanks

Rod

Re: UART Component - USB-UART FT232RL hardware

Posted: Tue Oct 26, 2021 11:35 am
by r_teixeir
HiMedelec here is the 1sec flasher

thnx

Rod

Re: UART Component - USB-UART FT232RL hardware

Posted: Tue Oct 26, 2021 12:10 pm
by medelec35
That instantly tells me the configuration of your flowchart does not match your hardware settings.
I have looked at a circuit for Easypic Pro and it has a crystal of 16MHz.
That means you run the microcontroller at either 16 (With PLL disabled) or 64MHz (With PLL enabled).
When I looked at your flowchart it was set at 19660800Hz which is a mismatch.
Try changing the Clock speed within Project options to 16000000 then do another flash test.
If the pulse is then 1 sec then try the UART again.
If it does not work then can you post the generated .c file please?

Re: UART Component - USB-UART FT232RL hardware

Posted: Tue Oct 26, 2021 12:22 pm
by r_teixeir
Medelec I appologize i didnt mention before. With these last tests I was running the programs with the easypic board 8Mhz clock and Pic18F45K22.
With this option does it match with your observation?

Re: UART Component - USB-UART FT232RL hardware

Posted: Tue Oct 26, 2021 12:30 pm
by medelec35
You will need to make sure the Flowcode Clock setting match the value of the crystal on your board.
If crystal is running at 8MHz ,then you need to change the clock from 19660800 to 8000000.
Both configuration settings of Mikroe and Flowcode should be the same.
The image does not show the crystal for the microcontroller.
If you look within the project options you will see the clock speed still does not match!
Configuation settings witin Project options.png
Configuation settings witin Project options.png (17.4 KiB) Viewed 8823 times

Re: UART Component - USB-UART FT232RL hardware

Posted: Tue Oct 26, 2021 1:34 pm
by r_teixeir
Hi Medelec i changed a config on the oscillator, disabled the PLL and it worked. The program was compiled in flowcode and the tests run nicely.

Your were right from the beginning on your obs about oscillation config.

Thanks I appreciate

Rod

Re: UART Component - USB-UART FT232RL hardware

Posted: Wed Oct 27, 2021 9:21 am
by medelec35
Hi, Rod
Glad you have got it working.
Thanks for letting us know.

Re: UART Component - USB-UART FT232RL hardware

Posted: Wed Oct 27, 2021 4:01 pm
by r_teixeir
Hi Medelec, I thank you for walking through this with me. It was great bc I even checked the differences in clock speeds by using 2 different circuits ft232rl and the USB-UART 2 click and i got them both working great on the microcontroller that I wanted to use. Pic18F87j50.

Thanks again

Rod

Re: UART Component - USB-UART FT232RL hardware

Posted: Fri Jan 28, 2022 6:35 am
by r_teixeir
Hi Martin, I changed the interrupt macro to the same way you've mentioned. Thanks for the tip. On the other side, Iam uploading two pics so you can check a problem that iam facing. Iam getting data using a third party uart by changing the anlog values on hardware, but while I use the flowcode Im not able to. Ive ran so many tests and I cant get the analog sent through uart using flowcode and BL0032, only by simulation not on hardware. I tested with, human interface, serial monitor just the uart component, etc. I did indeed got results of analog changing by using the serial monitor but had to let the connection on the serial monitor "open". I read this in wiki page "The incoming data can be seen on the Flowcode console even when the simulation is not running."

Please advise if Iam doing something wrong.

Thanks

Rod