Rs232 problem, please solve

General discussion on mikroElektronika website & forums.
Post Reply
Author
Message
Noor311
Posts: 8
Joined: 11 Jun 2014 20:31

Rs232 problem, please solve

#1 Post by Noor311 » 24 Jan 2015 12:09

Hello, i was trying to implement this simple code

Code: Select all

char uart_rd;

void main() {
  UART1_Init(9600);               // Initialize UART module at 9600 bps
  Delay_ms(100);                  // Wait for UART module to stabilize

  UART1_Write_Text("Start");
  UART1_Write(10);
  UART1_Write(13);

  while (1) {                     // Endless loop
    if (UART1_Data_Ready()) {     // If data is received,
      uart_rd = UART1_Read();     // read the received data,
      UART1_Write(uart_rd);       // and send data via UART
    }
  }
}

I used virtual terminal in proteus and hyperterminal but i only recieve start in virtual when i try writing smth i don't recieve it, in hyperterminal i don't get anything at all, is there anything wrong with the code?

User avatar
nemanja.nikolic
Posts: 171
Joined: 01 Dec 2014 10:50

Re: Rs232 problem, please solve

#2 Post by nemanja.nikolic » 26 Jan 2015 09:27

Hello,

We can not guarantee full compatibility with proteus.
Code works on easy pic.
Notes:
- load right scheme for your MCU,
- set right MCU clock,
- set same baud rate in terminal and in your code,
- set jumpers J3 and J4 in RS-232 position.

Nemanja.

Best regards.

Post Reply

Return to “Website & Forums General Discussion”