Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 4th June 2009, 03:30 AM   #1
Default uart transmitting

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...
butters is offline  
Old 4th June 2009, 03:31 AM   #2
Default

sorry about the title... my mistake.. uart receiving... =)
butters is offline  
Reply

Tags
transmitting, uart

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
Problem with MpLab :programming UArt for transmitting data.... fermat7 Micro Controllers 8 19th April 2009 05:51 PM
Transmitting tree's ? Mercur General Electronics Chat 19 23rd February 2009 01:52 AM
Increasing transmitting range? wikisi General Electronics Chat 4 21st February 2009 04:44 PM
UART Transmitting Problem winson Micro Controllers 9 20th January 2009 03:01 AM
Maximum transmitting distance mstechca Electronic Projects Design/Ideas/Reviews 7 4th September 2005 02:30 PM



All times are GMT. The time now is 01:08 PM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker