Thursday, January 13, 2011
Wednesday, January 12, 2011
Thursday, January 6, 2011
RS232 - RS485 - RS232 Converter Circuits
RS232 to RS485 Converter Circuit Cable
RS485 to RS232 Converter Circuit
RS232 to RS485 Converter Circuit
RS232 to RS485 Converter Circuit
RS232 to RS485 Converter Circuit
Saturday, January 1, 2011
How to Interface PIC16F877A / 18F452 with RS232C Serial Communication Using CCSC
Communication between a Microcontroller and a Computer is not a big thing. Use a level converter in between Microcontroller and PC. You can test it using a proteus simulation or directly connect your hardware to PC and use Hiper Terminal for Testing
Here a Simple code for testing Serial Communication
#include <16F877A.h>
#DEVICE ADC=10
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#use rs232 (baud=9600,rcv=PIN_C7, xmit=PIN_C6)
int count=0;
void main()
{
while(1){
//1 Sec Delay
delay_ms(1000);
//Increment Count
count ++;
if (count>60)
{ count=0;}
//Send data to PC
printf("\n\r Count Value: %d",count);
}
}
#DEVICE ADC=10
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#use rs232 (baud=9600,rcv=PIN_C7, xmit=PIN_C6)
int count=0;
void main()
{
while(1){
//1 Sec Delay
delay_ms(1000);
//Increment Count
count ++;
if (count>60)
{ count=0;}
//Send data to PC
printf("\n\r Count Value: %d",count);
}
}
Subscribe to:
Posts (Atom)