UART Component - USB-UART FT232RL hardware
Moderator: Benj
-
- Posts: 96
- Joined: Fri Jul 15, 2016 10:51 am
- Has thanked: 24 times
- Been thanked: 5 times
- Contact:
UART Component - USB-UART FT232RL hardware
Hi Team, Is it possible for the UART component to run the USB-UART hardware(FT232RL) in flowcode V8?
Thanks
Rod
Thanks
Rod
Last edited by r_teixeir on Mon Oct 25, 2021 7:40 am, edited 1 time in total.
-
- Posts: 96
- Joined: Fri Jul 15, 2016 10:51 am
- Has thanked: 24 times
- Been thanked: 5 times
- Contact:
UART component
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
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
- Attachments
-
- USB UART - Test.jpg (71.75 KiB) Viewed 8915 times
-
- USB UART - Pic.jpg (109.89 KiB) Viewed 8915 times
-
- Prog_5_USB_UART_Comm_Pic18F87k22.fcfx
- (10.41 KiB) Downloaded 154 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
Hi Rod.
Does this work any better?
Does this work any better?
- Attachments
-
- Prog_5_USB_UART_Comm_Pic18F87k22 v2.fcfx
- (11.58 KiB) Downloaded 152 times
Martin
-
- Posts: 96
- Joined: Fri Jul 15, 2016 10:51 am
- Has thanked: 24 times
- Been thanked: 5 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
Hi Medelec, thnx for replying. The result remains the same. Strange.
Rod
Rod
- Attachments
-
- version2.jpg (66.52 KiB) Viewed 8900 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
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?
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?
Martin
-
- Posts: 96
- Joined: Fri Jul 15, 2016 10:51 am
- Has thanked: 24 times
- Been thanked: 5 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
Hi Medlec Ive just ran a test with a hello world from mikroe's echo example
It is working fine.
Thanks
Rod
It is working fine.
Thanks
Rod
- Attachments
-
- Hardware Test - Hello World Uart- Mikroe .jpg (103.26 KiB) Viewed 8894 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
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.
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.
Martin
-
- Posts: 96
- Joined: Fri Jul 15, 2016 10:51 am
- Has thanked: 24 times
- Been thanked: 5 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
Hi Medelc, here is the 1sec flasher. It seems right.
Thnx
Rod
Thnx
Rod
- Attachments
-
- 1sec flasher.jpg (53.09 KiB) Viewed 8889 times
-
- Posts: 96
- Joined: Fri Jul 15, 2016 10:51 am
- Has thanked: 24 times
- Been thanked: 5 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
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
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
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
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: For the version I posted, you will need to add a calculation macro: Are you running at least Flowcode V8.2.2.15?
Do you have an oscilloscope or logic analyser?
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: For the version I posted, you will need to add a calculation macro: Are you running at least Flowcode V8.2.2.15?
Do you have an oscilloscope or logic analyser?
Martin
-
- Posts: 96
- Joined: Fri Jul 15, 2016 10:51 am
- Has thanked: 24 times
- Been thanked: 5 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
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
Ill run the tests again about the comm again tonight and let you know about it.
Thanks
Rod
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
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?
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?
Martin
-
- Posts: 96
- Joined: Fri Jul 15, 2016 10:51 am
- Has thanked: 24 times
- Been thanked: 5 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
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
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
- Attachments
-
- Logic analyser.jpg (56.62 KiB) Viewed 8851 times
-
- version2.jpg (66.52 KiB) Viewed 8851 times
-
- Posts: 96
- Joined: Fri Jul 15, 2016 10:51 am
- Has thanked: 24 times
- Been thanked: 5 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
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
I tried to test again by coding using flowocode and the error remains.
So what now?
Thanks for the help
Rod
- Attachments
-
- Test worked.jpg (60.58 KiB) Viewed 8850 times
-
- Posts: 96
- Joined: Fri Jul 15, 2016 10:51 am
- Has thanked: 24 times
- Been thanked: 5 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
Hi Medelec im getting error attached
thnx
Rod
thnx
Rod
- Attachments
-
- error message.jpg (27.83 KiB) Viewed 8847 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
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?
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?
Martin
-
- Posts: 96
- Joined: Fri Jul 15, 2016 10:51 am
- Has thanked: 24 times
- Been thanked: 5 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
Hi Medelec I wrote my name as one single hit and i got this.
Thanks
Rod
Thanks
Rod
- Attachments
-
- Analyser_Teste-Rodrigo.jpg (93.26 KiB) Viewed 8828 times
-
- Posts: 96
- Joined: Fri Jul 15, 2016 10:51 am
- Has thanked: 24 times
- Been thanked: 5 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
HiMedelec here is the 1sec flasher
thnx
Rod
thnx
Rod
- Attachments
-
- 1sec flasher.jpg (42.6 KiB) Viewed 8828 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
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?
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?
Martin
-
- Posts: 96
- Joined: Fri Jul 15, 2016 10:51 am
- Has thanked: 24 times
- Been thanked: 5 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
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?
With this option does it match with your observation?
- Attachments
-
- EasypicBoard Uart via USB.jpg (130.44 KiB) Viewed 8816 times
-
- USB_UART_Pic18F45K22.fcfx
- (10.94 KiB) Downloaded 106 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
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!
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!
Martin
-
- Posts: 96
- Joined: Fri Jul 15, 2016 10:51 am
- Has thanked: 24 times
- Been thanked: 5 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
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
Your were right from the beginning on your obs about oscillation config.
Thanks I appreciate
Rod
- Attachments
-
- USB UART - Test.jpg (65.99 KiB) Viewed 8793 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
Hi, Rod
Glad you have got it working.
Thanks for letting us know.
Glad you have got it working.
Thanks for letting us know.
Martin
-
- Posts: 96
- Joined: Fri Jul 15, 2016 10:51 am
- Has thanked: 24 times
- Been thanked: 5 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
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
Thanks again
Rod
-
- Posts: 96
- Joined: Fri Jul 15, 2016 10:51 am
- Has thanked: 24 times
- Been thanked: 5 times
- Contact:
Re: UART Component - USB-UART FT232RL hardware
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
Please advise if Iam doing something wrong.
Thanks
Rod
- Attachments
-
- Analog_Output_Pot_Graph.jpg (115.95 KiB) Viewed 7374 times
-
- Analog_Output_Pot_Flowcode.jpg (114.58 KiB) Viewed 7374 times
-
- PROG_Test_Analog_Pot_Uart.fcfx
- (16.96 KiB) Downloaded 83 times