Page 1 of 1

32MS250 UART failure

Posted: Sun Sep 18, 2016 10:27 pm
by Pascal_2016
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

Re: 32MS250 UART failure

Posted: Mon Sep 19, 2016 10:14 am
by Benj
Hello,
CPU 32MS250
Really not sure what chip you mean by this. Can you please double check this is correct.

Re: 32MS250 UART failure

Posted: Mon Sep 19, 2016 9:25 pm
by Pascal_2016
The CPU ist 32MX250

Re: 32MS250 UART failure

Posted: Tue Sep 20, 2016 10:03 am
by Benj
Sounds like this is linked to the clock issue you're having. If you fix that then this should also be fixed.

Re: 32MS250 UART failure

Posted: Tue Sep 20, 2016 8:11 pm
by Brendan
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