I have PIC24F connected to FDTI FT232 and connected to PC (reading with terminal software).
When I try to send codes from 1 to 255 as a test to FDTI I receive a mess in terminal. Every time it's different.
Didn't find any examples how to work with CAL_UART, but seems it's quite easy. What's wrong?
CAL_UART and FDTI
Moderator: Benj
- mikn
- Posts: 209
- Joined: Mon Mar 03, 2014 10:11 pm
- Has thanked: 54 times
- Been thanked: 41 times
- Contact:
CAL_UART and FDTI
- Attachments
-
- mess
- sc-mess1.GIF (8.45 KiB) Viewed 2956 times
-
- code
- sc-mess.GIF (21.3 KiB) Viewed 2956 times
FC 6.1.3.2 (18.02.2016)
- Jordy101091
- Posts: 519
- Joined: Sat Jan 08, 2011 4:02 pm
- Location: The Netherlands
- Has thanked: 25 times
- Been thanked: 188 times
- Contact:
Re: CAL_UART and FDTI
Maybe your terminal program translates the received information to ASCII characters.
I think the best way to do this is to send all information as a string, so you need to convert you variable i to string e.g. i_str.
Hope this helps you.
Regards Jordy
I think the best way to do this is to send all information as a string, so you need to convert you variable i to string e.g. i_str.
Hope this helps you.
Regards Jordy
the will to learn, should not be stopped by any price
- mikn
- Posts: 209
- Joined: Mon Mar 03, 2014 10:11 pm
- Has thanked: 54 times
- Been thanked: 41 times
- Contact:
Re: CAL_UART and FDTI
I've tried to send just 1 byte and it receives different values every time.
FC 6.1.3.2 (18.02.2016)
-
- 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: CAL_UART and FDTI
Hi mikn,
It looks like for some reason the baud rate is different as intended.
Looks like a timing issue.
Can you check to see if hardware is running at the correct frequency?
Before starting any new project It's always a good idea to set up a 1Hz flasher.
I.e
Do:
A0=1
Delay 500ms
A0=0
Delay 500ms
Loop while 1
Do the baud rate of terminal program and settings of uart properties the same.
I would recommend setting both up at say 9600 for testing purposes.
If I can find my PIC24F chip, I can carry out some tests, but that is not 100% definite.
Martin
It looks like for some reason the baud rate is different as intended.
Looks like a timing issue.
Can you check to see if hardware is running at the correct frequency?
Before starting any new project It's always a good idea to set up a 1Hz flasher.
I.e
Do:
A0=1
Delay 500ms
A0=0
Delay 500ms
Loop while 1
Do the baud rate of terminal program and settings of uart properties the same.
I would recommend setting both up at say 9600 for testing purposes.
If I can find my PIC24F chip, I can carry out some tests, but that is not 100% definite.
Martin
Martin
- mikn
- Posts: 209
- Joined: Mon Mar 03, 2014 10:11 pm
- Has thanked: 54 times
- Been thanked: 41 times
- Contact:
Re: CAL_UART and FDTI
Did test with LED at 16mhz:
FRC - blinks twice slower
FRC with PLL - blinks normal
FRC with Prescaler - blinks 4 times slower
I thought that normal setting is FRC with PLL, but... when I change to 32MHz and set FRC with PLL it blinks twice slower.
Seems like it's the same problem with oscillator like I have in my FAT and ADC project http://www.matrixmultimedia.com/mmforum ... 54&t=14494.
UPD: Solved.
Changed Return to 16 bits instead of 8 bits and it worked.
PS What do these parameters mean: Return, Echo, Interrupt?
FRC - blinks twice slower
FRC with PLL - blinks normal
FRC with Prescaler - blinks 4 times slower
I thought that normal setting is FRC with PLL, but... when I change to 32MHz and set FRC with PLL it blinks twice slower.
Seems like it's the same problem with oscillator like I have in my FAT and ADC project http://www.matrixmultimedia.com/mmforum ... 54&t=14494.
UPD: Solved.
Changed Return to 16 bits instead of 8 bits and it worked.
PS What do these parameters mean: Return, Echo, Interrupt?
- Attachments
-
- yahoo
- sc-hello.GIF (7.84 KiB) Viewed 2947 times
FC 6.1.3.2 (18.02.2016)