hansika
Member level 2
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.
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.