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