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
 
LinkBack Thread Tools Display Modes
Old 6th May 2004, 11:25 AM   (permalink)
Default PIC to PC communication.

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.
__________________
MOTGI ANUPAMA.
ANUPAMA is offline  
Old 14th May 2004, 02:21 PM   (permalink)
Default

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?
__________________
***ljose***
leojose is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 05:40 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker