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?
Pic32MZ2048EFH100 /200Mhz Uart's too slow
Moderator: Benj
-
- Posts: 39
- Joined: Sat Jul 16, 2016 12:08 pm
- Has thanked: 4 times
- Been thanked: 2 times
- Contact:
Pic32MZ2048EFH100 /200Mhz Uart's too slow
- Attachments
-
- Oit Heizung V1.fcfx
- (17.55 KiB) Downloaded 338 times
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: Pic32MZ2048EFH100 /200Mhz Uart's too slow
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
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
-
- 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: Pic32MZ2048EFH100 /200Mhz Uart's too slow
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.
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.
Martin
-
- Posts: 39
- Joined: Sat Jul 16, 2016 12:08 pm
- Has thanked: 4 times
- Been thanked: 2 times
- Contact:
Re: Pic32MZ2048EFH100 /200Mhz Uart's too slow
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
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
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: Pic32MZ2048EFH100 /200Mhz Uart's too slow
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
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
- 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: Pic32MZ2048EFH100 /200Mhz Uart's too slow
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
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
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 39
- Joined: Sat Jul 16, 2016 12:08 pm
- Has thanked: 4 times
- Been thanked: 2 times
- Contact:
Re: Pic32MZ2048EFH100 /200Mhz Uart's too slow
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
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