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.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…