FC8 uart speed Pic32 MX440F256H

Moderator: Benj

Post Reply
stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

FC8 uart speed Pic32 MX440F256H

Post by stefan.erni »

I have a problem with the speed of the uart. It's factor 2 wrong.
In FC8 it's 115000 and in the terminalprogram I need to config as 57600.
If I use the custom baud option in FC8 with 230400 and in the terminalprogramm 115000
it's working too.
But I can not custom baud option in FC8 with 2*921600=1'843'200

If it's possible to add some higher speed in the pulldown menue and test it?

230400Bd
460800Bd
921600Bd

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: FC8 uart speed Pic32 MX440F256H

Post by QMESAR »

Hi All

This is an old issue that has been discussed a few time with no end result or solution :D )I have uploaded a few mE projects and MPLABx project in the past that shows this error in FC :D

Stefan please do a delay test (it will yield a too slow or double period)and you will notice that anything in the PIC32 that FC calculates you will see it is 2 time slower that is should be.

To solve your issue setup the UART manually avoid the auto calculation stuff on PIC32 in FC

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: FC8 uart speed Pic32 MX440F256H

Post by Benj »

Hello,

What setting do you have on the peripheral divider in the configuration options?
PerClock.png
(14.63 KiB) Downloaded 2149 times

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: FC8 uart speed Pic32 MX440F256H

Post by stefan.erni »

Hi Ben
Here is the config options
regards
Stefan
FC8_Clockset_80MHz.PNG
(148.79 KiB) Downloaded 2142 times

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: FC8 uart speed Pic32 MX440F256H

Post by stefan.erni »

Hi Ben

If I change the settings like in the picture then it's ok

regards

Stefan
FC8_Clockset_80MHz_version2.PNG
(149.82 KiB) Downloaded 2139 times
FC8_Clockset_Diagramm.PNG
(172.68 KiB) Downloaded 2139 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: FC8 uart speed Pic32 MX440F256H

Post by Benj »

Many thanks,

Can you try setting the peripheral clock to /2 and see if it solves the speed issue on the UART.

Regarding the SPI rate, there is likely a cap on how fast this can reliably run, a 50MHz clock is likely a massive source of EM noise and capacitance will likely have a big impact on this running correctly.

Whoops you beat me to it :D Glad you have it running correctly now.

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: FC8 uart speed Pic32 MX440F256H

Post by stefan.erni »

Hi Ben

I controled the time of the IRQ and delay.
For the IRQ I choosed 4kHz and it's 4kHz
the delay I choosed 1Sek and it's 500mSek

The Uart is ok.

Is there a magic trick that all the time and speed are ok?
If not, how should I proceed?

regards

Stefan

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: FC8 uart speed Pic32 MX440F256H

Post by Benj »

Hello Stefan,

Right please set the peripheral clock divider back to /1, run the check for updates to get the latest definition file and restart Flowcode once you have downloaded the update. Hopefully this will allow delays, timers and UART baud to be correct. Just checked on a 32MX250F128B device and all working well so fingers crossed.

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: FC8 uart speed Pic32 MX440F256H

Post by stefan.erni »

Hi Ben

With FC8 make update pleasure. I can see what is being updated and I just have to press OK
I do not have to unzip ...
I have tested the MX440F256H and Delay, Uart and IRQ speed is correct now.
Soon I will test the Pic32MZ2048
Also, I test the speed of SPI, I2C, Delay, IRQ and Uart
and if it is ok i will post settings and results here.

regards

Stefan

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: FC8 uart speed Pic32 MX440F256H

Post by stefan.erni »

Hi Ben

I tested the speed on Pic32MZ2048
at first the good news.....
The SPI Hardware is fast..... Fosz/2 is 50MHz perfect! Thats what I need for the SD-card
The delay and the IRQ timing looks also correct.
scope_0.png
(20.58 KiB) Downloaded 2044 times
What ever I did, the I2C is not working. the program hang in the PIC if I transmit a Byte, even if I use hard or software I2C. (But the IRQ is still working) and the simulation is ok .


The uart hardware is halfspeed what I choosed in FC. (in the PIC MX440 it was ok, I check it again....)
but with the uart software, the speed is correct.


regards


Stefan

Post Reply