Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Verify my dspic30f code for serial communication

Status
Not open for further replies.

hansika

Member level 2
Joined
Apr 13, 2010
Messages
53
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
hyderabad
Activity points
1,717
hi all,
i have write a code in mikroC IDE for serial communication dspic30f6014A when i am sending a character say 's' to PC i am not getting that correctly i have set the baud rate in pc and in dspic same only . below is my code please verify and suggest me where i am doing wrong

unsigned rx1;

void main()
{
//LATB=0;
//ADPCFG=0xFF;
TRISB=0;
LATBBITS.LATB0=1;
LATBBITS.LATB1=1;
Uart_Init_Advanced(9600,0,0);
Uart_Write_Char('s');

while(1)
{
if (Uart1_Data_Ready())
{
rx1 = Uart_Read_Char();
Uart_Write_Char(rx1);
}

}
when i am sending character 's' i am getting some junk value . i am dumped the code using winpic800.
 

Re: dspic30f issue

I usually use microchip C30 compiler .But with a Uart init routine .You should read what else needs to be initialized on the Dspic .Those chips have lots of stuff.They have to be carefully initialized .Otherwise you end up in problems like the one you have .You need to read the compiler doc for that routine as well as understand with the particuliar Datasheet what is required to have that baudrate that you need.

So is not an issue is just a work to do from your part.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top