• 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.

uart transmitting

Status
Not open for further replies.

butters

Member
hi all...
i need to transmit bits from pc to pic...
i dont know how to start apart from this code i got hold of

Code:
#include <p18C452.h>
#include <usart.h>

void main(void)

{

  // configure USART

  OpenUSART( USART_TX_INT_OFF  &

             USART_RX_INT_OFF  &

             USART_ASYNCH_MODE &

             USART_EIGHT_BIT   &

             USART_CONT_RX     &

             USART_BRGH_HIGH,25 );

 

  while(1)

  {

    while( ! PORTAbits.RA0 );  //wait for RA0 high

 

    WriteUSART( PORTD );       //write value of PORTD

 

    if(PORTD == 0x80)          // check for termination

      break;                   //   value

  }

 

  CloseUSART();

}
so from what i know is that i need to configure uart receiving (pic).. and im using rs-485 to communicate.. hence theres a rs232 to rs485 converter..


so here's the order

hyperterminal > rs232/rs485 converter > rs485 > pic...
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top