Hello?
I am working on a project with PIC33EP256MC202.
I want to do serial communication at 19200 baud.
However, it does not work properly.
I set it to 19200 in FC10, but it appears normally at 2400 baud.
It seems that the oscillator setting is wrong.
I will upload the operating status.
Please help me set it up.
Thank you.
Clock setting Help!!
-
- Posts: 207
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 03, 2020 1:43 pm
- Has thanked: 5 times
- Been thanked: 7 times
Clock setting Help!!
- Attachments
-
- 1.jpg (54.57 KiB) Viewed 1651 times
-
- 2.jpg (90.37 KiB) Viewed 1651 times
-
- 3.jpg (94.48 KiB) Viewed 1651 times
Re: Clock setting Help!!
Here my project
- Attachments
-
- 250304-V002.fcfx
- (33.96 KiB) Downloaded 26 times
-
- Matrix Staff
- Posts: 1955
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 626 times
- Been thanked: 656 times
Re: Clock setting Help!!
Hello.
What osc speed are you after?
I have added c code to hopefully set the osc speed to 16MHz as that is what your program options show.
The internal osc Speed can be upto 64 MHz, so I would recommend being set to higher than 16MHz.
Can you let me know if not working 16MHz ,then I will look into this further.
What osc speed are you after?
I have added c code to hopefully set the osc speed to 16MHz as that is what your program options show.
The internal osc Speed can be upto 64 MHz, so I would recommend being set to higher than 16MHz.
Can you let me know if not working 16MHz ,then I will look into this further.
- Attachments
-
- 250304-V002.fcfx
- (34.33 KiB) Downloaded 17 times
Martin
Re: Clock setting Help!!
Thanks for your help.
I haven't tested it yet.
I'll test it tomorrow when I get to work.
I want to run it at the maximum speed this MCU can handle, or 64MHz.
Thanks for helping me set it up.
I haven't tested it yet.
I'll test it tomorrow when I get to work.
I want to run it at the maximum speed this MCU can handle, or 64MHz.
Thanks for helping me set it up.
-
- Matrix Staff
- Posts: 1955
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 626 times
- Been thanked: 656 times
Re: Clock setting Help!!
Hi.
You're welcome.
Hopefully, attached will run at 64MHz.
I have never used dspic devices so fingers crossed it will work.
You're welcome.
Hopefully, attached will run at 64MHz.
I have never used dspic devices so fingers crossed it will work.
- Attachments
-
- 250304-V002 64MHz.fcfx
- (33.49 KiB) Downloaded 15 times
Martin
Re: Clock setting Help!!
I ran the project by setting it as you helped me.
However, it doesn't run properly.
If I select 64mhz in C Code, I should select 8mhz in the settings.
Serial communication works normally, but 2400Baud and 38400baud or higher don't work. MCU works very slowly.
Do I need to change other settings? Please tell me how.
Thank you.
However, it doesn't run properly.
If I select 64mhz in C Code, I should select 8mhz in the settings.
Serial communication works normally, but 2400Baud and 38400baud or higher don't work. MCU works very slowly.
Do I need to change other settings? Please tell me how.
Thank you.
- Attachments
-
- 1.jpg (172.88 KiB) Viewed 1548 times
-
- 2.jpg (84.76 KiB) Viewed 1548 times
-
- Valued Contributor
- Posts: 1012
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 193 times
- Been thanked: 217 times
Re: Clock setting Help!!
Hi seokgi , Hi Martin
It is also possible to change the BRG register without the clock. The number 216 works for me for 115200.
You can calculate this for your configuration or try it out. For very slow baud rates you should also look at bit3 in the U2MODE register
Insert after Monitor init: Program: From the data pdf PIC:
It is also possible to change the BRG register without the clock. The number 216 works for me for 115200.
You can calculate this for your configuration or try it out. For very slow baud rates you should also look at bit3 in the U2MODE register
Insert after Monitor init: Program: From the data pdf PIC:
-
- Matrix Staff
- Posts: 1955
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 626 times
- Been thanked: 656 times
Re: Clock setting Help!!
Thanks Stefan.
Hi seokgi
It would be good to know at what clock speed hardware is running at.
The easiest way is to run a 1 sec flash test and measure the time duration the LED is on for, or you can use a scope or a logic analyser.
Then we can see if its an issue with the clock frequency or the UART component.
If it's the clock frequency it can be revisited.
Hi seokgi
It would be good to know at what clock speed hardware is running at.
The easiest way is to run a 1 sec flash test and measure the time duration the LED is on for, or you can use a scope or a logic analyser.
Then we can see if its an issue with the clock frequency or the UART component.
If it's the clock frequency it can be revisited.
Martin
-
- Matrix Staff
- Posts: 1955
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 626 times
- Been thanked: 656 times
Re: Clock setting Help!!
Sorry, I spotted an issue.
Can you try with the attached.
Can you try with the attached.
- Attachments
-
- 250304-V002 64MHz.fcfx
- (33.49 KiB) Downloaded 22 times
Martin