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.

[PIC] PIC UART communicaion with PC

Status
Not open for further replies.

Naseer Ahmed

Newbie level 5
Joined
Feb 19, 2015
Messages
9
Helped
1
Reputation
2
Reaction score
1
Trophy points
3
Location
Islamabad, Pakistan, Pakistan
Activity points
113
Hello dear friends,

Please guide me against the following problem:

I am trying to develop uart communication between PIC 16F877A (20 MHz crystal) and PC using hyper terminal.

I wrote the following simple code in mikroc Pro v.6.5.0 compiler to run:

Code:
char RS;

void main()

{
   TRISC = 0xF0;

    Uart1_Init(9600);

  while(1)
  {
      if (uart1_data_ready()==1)
    {
        RS = uart1_read();

        uart1_write(RS);
     }
  }
}

But it is not working.

I have tested the serial cable and MAX 233 IC by shorting TX and Rx together and these are working properly.

The protocols are also same:

Baud rate of both PC and code are 9600 bps each
data bits 8
No parity bit
stop bit 1.

Can you kindly tell the point of problem?

Thanks

Regards

Naseer Ahmed
 

Hello dear friends,

Please guide me against the following problem:

I am trying to develop uart communication between PIC 16F877A (20 MHz crystal) and PC using hyper terminal.

I wrote the following simple code in mikroc Pro v.6.5.0 compiler to run:

Code:
char RS;

void main()

{
   TRISC = 0xF0;

    Uart1_Init(9600);

  while(1)
  {
      if (uart1_data_ready()==1)
    {
        RS = uart1_read();

        uart1_write(RS);
     }
  }
}

But it is not working.

I have tested the serial cable and MAX 233 IC by shorting TX and Rx together and these are working properly.

The protocols are also same:

Baud rate of both PC and code are 9600 bps each
data bits 8
No parity bit
stop bit 1.

Can you kindly tell the point of problem?

Thanks

Regards

Naseer Ahmed


Could you update your uart function and interrupt routine?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top