Hello
CPU 32MS250
My config settings are as follows:
#pragma config FNOSC = FRCPLL
#pragma config FPLLIDIV = DIV_2
#pragma config FPLLMUL = MUL_20
#pragma config FPLLODIV = DIV_2
#pragma config FPBDIV = DIV_1
#pragma config DEBUG = OFF
#define GetSystemClock() (40000000ul)
#define GetPeripheralClock() (GetSystemClock())
#include <plib.h>
My config settings for UART are as follows:
channel 2, Baud_List = 9600, DBit = 8bit,TXRemap = PORT B4, RXRemap = PORT A1.
The bits are too slow on Port B4.
With my settings
U2MODEbits.BRGH = 1;
U2BRG = 84;
The data is transferred with 9600 baud
What I am doing as wrong.
Please Can You help me
32MS250 UART failure
Moderator: Benj
-
Pascal_2016
- Posts: 89
- Joined: Wed Aug 31, 2016 4:48 pm
- Been thanked: 4 times
- 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: 32MS250 UART failure
Hello,
Really not sure what chip you mean by this. Can you please double check this is correct.CPU 32MS250
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
-
Pascal_2016
- Posts: 89
- Joined: Wed Aug 31, 2016 4:48 pm
- Been thanked: 4 times
- 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: 32MS250 UART failure
Sounds like this is linked to the clock issue you're having. If you fix that then this should also be fixed.
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
-
Brendan
- Posts: 243
- Joined: Tue Nov 27, 2012 12:53 pm
- Location: Cambridge, UK
- Has thanked: 140 times
- Been thanked: 118 times
- Contact:
Re: 32MS250 UART failure
We've overcome a number of... 'challenges' getting the UART baud rate and associated registers correct for a given clock frequency with this PIC family.
The following information may possibly be of some assistance when working with these complex new devices...
http://stackoverflow.com/questions/1770 ... -baud-rate
http://www.microchip.com/forums/m824389.aspx
http://www.microchip.com.tw/Data_CD/Ref ... 20UART.pdf
Best regards,
Brendan
The following information may possibly be of some assistance when working with these complex new devices...
http://stackoverflow.com/questions/1770 ... -baud-rate
http://www.microchip.com/forums/m824389.aspx
http://www.microchip.com.tw/Data_CD/Ref ... 20UART.pdf
Best regards,
Brendan
LinkedIn Profile...
http://www.linkedin.com/in/brendantownsend
http://www.linkedin.com/in/brendantownsend