Continue to Site

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.

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

PIC to PC communication.

Status
Not open for further replies.

ANUPAMA

New Member
hi,
I'm trying to send some characters from PIC (program is below) with RS232 and max232 ic. on pc side i'm trying to check whether im receiving the proper data or not with 'real term ' software , before that i tried with VB but each time im not getting a single proper characters . can anyone tell whay may be the problem? here i'm giving below my PIC program which is in c ianguage and writng that with MPLAB.
the program is:

\\ASYNCHRONOUS COMMUNICATION OF PIC
#include<pic.h>
void delay(void);
int i;
void main(void)
{
BRGH=1;
SPBRG=0x19; //BAUD RATE SETTING
SYNC=0; //SELECTING ASYNCHRONOUS MODE
SPEN=1; //SERIAL PORT ENABLED
TXEN=1; //TRANSMISSION ENABLED
while(1)
{
TXREG=0x45; //SENDING CHARACTER 'E'
delay();
while(!TXIF); //WAITING TILL TXREG sets
TXREG=0x54; //SENDING CHARACTER 'T'
delay();
while(!TXIF); //WAITING TILL TXREG sets
}
}
void delay()
{
for(i=0;i<30000;i++);
}
in need of urgent help.

ANUPAMA.
 
Hi,

The value doesn't appear as required when the baud rates of your controller and pc don't match. PCs normally have a baud rate of 9600bps.verify your baud rate.By the way, which controller and at what frequency are you using your application?
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top