Page 1 of 1

Pic32MZ2048EFH100 /200Mhz Uart's too slow

Posted: Fri Apr 17, 2020 1:43 pm
by Speed64
Hello,
I have a problem.
PIC32mz2048efh100 with 24Mhz external clock.
200Mhz system clock
Uart3 = 9600 baut
sends with 2400 baut.
download/file.php?mode=view&id=31652

where is the mistake?

Re: Pic32MZ2048EFH100 /200Mhz Uart's too slow

Posted: Fri Apr 24, 2020 10:18 am
by stefan.erni
Hi Speed64


You can insert a C Code with a line like this.
This C Code has to be after the init the Uart!
I did not try the 9600 baud but for the 115200 it's working nice.

U1BRG=2592; // setzt uart 1 auf 9600
U4BRG=216; // setzt uart 4 auf 115200

regards

Stefan

Re: Pic32MZ2048EFH100 /200Mhz Uart's too slow

Posted: Fri Apr 24, 2020 10:59 am
by medelec35
Hi Speed64,
before changing any register values, make sure that clock speed and configuration settings are correct.
You can do that by running a 1 second flash test.

Re: Pic32MZ2048EFH100 /200Mhz Uart's too slow

Posted: Fri Apr 24, 2020 2:37 pm
by Speed64
hello medelec35

I have the test via an interrupt (clock 10ms) in the software
Interrupt call "measure"
in "Measure" count up to 50 then set A6 = 1
and count up to 100 then set A = 0 and count to 0
so on, that works ok

hello stefan.erni
it works now

is that a compiler error?
normally this works for most chips without the C code

Thanks again

Re: Pic32MZ2048EFH100 /200Mhz Uart's too slow

Posted: Fri Apr 24, 2020 4:05 pm
by stefan.erni
Hi Speed64, Hi Medelec

PIC32MX and PIC32MZ have different value for the Baudrateregister and there is a BRGH Bit to set or clear.

I don't really know that either. But the problem is just in the PIC32MZ and not in another PIC like PIC16.

regards

Stefan

Re: Pic32MZ2048EFH100 /200Mhz Uart's too slow

Posted: Fri Apr 24, 2020 4:26 pm
by Benj
Hello,

Have you done a 1 second flash test to confirm your micro is running at the right speed?
https://www.matrixtsl.com/wiki/index.ph ... ED_flasher

Re: Pic32MZ2048EFH100 /200Mhz Uart's too slow

Posted: Mon Apr 27, 2020 9:22 am
by Speed64
hello stefan.erni , medelec35 , Benj


the C code here from stefan.erni has helped. Danke

U3BRG=2592; // setzt uart 3 auf 9600 // sets Uart3 to 9600 baut
This C Code has to be after the init the Uart!
According to the data sheet, this is a divider for the UART
a bug for me

does the value have to be changed when the clock is changed?


Hi Benj
Have you done a 1 second flash test to confirm your micro is running at the right speed?
Yes of course
I tested it as described above

Thanks again