Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

mikroc pro usart terminal

Status
Not open for further replies.

einton

New Member
hi guys i m getting some problems in sending commands through mikroc pro usart terminal. can any one tell me any manual or else to get some info of it
thanx
 
Usart

Hi Einton

It's Rupert again - what exactly are you having problems with?

Library Example
The example demonstrates a simple data exchange via UART. When PIC MCU
receives data, it immediately sends it back. If PIC is connected to the PC (see the
figure below), you can test the example from the mikroC PRO for PIC terminal for
RS-232 communication, menu choice Tools › Terminal.
Code:
char uart_rd;
void main() {
   UART1_Init(9600);                      // Initialize UART module at 9600 bps
   Delay_ms(100);                         // Wait for UART module to stabilize
   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
      }
   }
}

Please let me know what the problem is and I will try to help more.

Best regards,

Rupert
 
Last edited:
USART Problem

Hey gaspode,

I have pasted your code into mikroc, compiled it, flashed my microcontroller. But when i connect the microcontroller to hyperterminal to check if its actually working.

If i sent the letter 'a', it replies with 'øø'

if i send the letter 'b' it replies with 'fø'

it keeps replying with weird symbols.

What could be the problem?
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top