vijaya_narayana
Full Member level 3
Dear All
I am Trying to configure UART MODULE for 9600 Baud rate in dsPIC33EP512GM710 and here is my Code i am just trying to send a char to be monitored in serial port in the PC
my code for calculating the baud rate
my code for configuring the PLL and clock i am trying to calculate the same for 40Mhz operation with an external crystal of 10 Mhz
pls correct me if my setting are wrong
I am Trying to configure UART MODULE for 9600 Baud rate in dsPIC33EP512GM710 and here is my Code i am just trying to send a char to be monitored in serial port in the PC
my code for calculating the baud rate
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #define _XTAL_FREQ 10000000 #define FP 40000000 #define BAUDRATE 9600 #define BRGVAL ((FP/BAUDRATE)/16)-1 ////clock settings PLLFBD = 30; // M=32 CLKDIVbits.PLLPOST = 0; // N1=2 CLKDIVbits.PLLPRE = 0; // N2=2 OSCTUN = 0; // Tune FRC oscillator, if FRC is used // Initiate Clock Switch to Primary Oscillator with PLL (NOSC=0b011) __builtin_write_OSCCONH(0x03); __builtin_write_OSCCONL(OSCCON | 0x01); // Wait for Clock switch to occur while (OSCCONbits.COSC!= 0b011); // Wait for PLL to lock while (OSCCONbits.LOCK!= 1);
my code for configuring the PLL and clock i am trying to calculate the same for 40Mhz operation with an external crystal of 10 Mhz
pls correct me if my setting are wrong
Last edited by a moderator: