CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

rs232 problem!!

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ryan
Guest







rs232 problem!!
PostPosted: Thu May 19, 2005 9:52 am     Reply with quote

I got a problem.I cannot receive any text from my pic.Can someone help me??i use pic16f877,xtal 20Mhz,pcm v3.219.
i use a simple code but the result still the same.

#include <16F877.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP // May need to be changed depending on the chip
// Change if you use a different chip
#use delay(clock=20000000) // Change if you use a different clock
#use rs232(baud=4800, xmit=PIN_C6, rcv=PIN_C7)
// Connect RS232 driver to PIC pins C6,C7

main() {
char c;

printf("Program is running, Start typing:\r\n");
while(TRUE) {
c=getc();
putc(c+1); // Echo the next char, A echos as B and so on
}

}

my pic is connected to max232 and then to pc.I use hyper terminal to receive/transmit the text.Or i need something other than hyper terminal??

pls help me........
Ttelmah
Guest







PostPosted: Thu May 19, 2005 9:59 am     Reply with quote

Make sure that the port is setup in the advanced settings on the PC, to have handshake set to 'none'. Otherwise unless you make the handshake connections to the PC, it may never see the port become 'active'. If it still doesn't work, you may have a wiring problem. Is the MAX232, developing it's +/-12v supplies correctly?. Can you check that there is activity on the serial line itself?. Have you got the 0v connection made as well as the data lines?. (some of these are very 'obvious', but it is amazing how often they get missed!...).

Best Wishes
Christophe



Joined: 10 May 2005
Posts: 323
Location: Belgium

View user's profile Send private message

PostPosted: Fri May 20, 2005 3:28 am     Reply with quote

Use a scope to measure what is coming on the TX pin of the PIC:

=> if you don't see data, ther's something wrong with your pic or with your software

Measure TXIN of the max232:

=> if you don't see data, the lines aren't conncted

Then measure TXOUT of the MAX232:

=>If you don't see data, there 's probably something wrong with the MAX232. If you SEE data, check your PC settings..

good luck!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group