receiving tons of dummy data from computer port

Status
Not open for further replies.

einton

New Member
Hi guys , i m involved in quite a annoying problem , the problem is when i tried to interface pic18f2580 to computer com port using program in mikroc pro i eventually received tons of dummy data without any break i dont know the problem but the data look like this

i m using the advanced port terminal i have also used mikroc pro usart tool but the same tons of data i eventually receive when i plug on , my program follows as

Code:
char uart_rd;

void main() {

  ADCON1 |= 0x0F;                 // Configure AN pins as digital

  UART1_Init(9600);               // Initialize UART module at 9600 bps
  Delay_ms(1000);                  // Wait for UART module to stabilize


  while (1) {
  

   if (UART1_Data_Ready()) {      // If data is received,
     uart_rd = UART1_Read();      //   read the received data,
     UART1_Write(uart_rd);

    }
  }
 }

i dont know what the possible reason could be i haev checked the board and i think all connections are fine , please tell any thing if u could suggest.
 
6B = 01101011
DB = 11011011

All your data is alternating between 1 and 0, I think you might have the wrong baudrate selected somewhere.
 
The fact that data is received when none is being sent suggests the wrong polarity. Or, the OP has both ends set to echo received data.

Mike.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…