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 support@ccsinfo.com

PIC18f2550 and rs232 garbage

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



Joined: 03 Jul 2009
Posts: 8

View user's profile Send private message

PIC18f2550 and rs232 garbage
PostPosted: Fri Jul 03, 2009 10:33 am     Reply with quote

Hi, I'm trying to work with rs232 on pic18f2550 but with a simple test program in my hyperterminal I see only garbage . Originally, I need to implement a simple rs232 protocol to transfer a data stream with pll enabled (4MHz external crystal) but with pll enabled (fuses HSPLL and #use delay( clock=48000000 ) ) or not (only HS fuses enabled) the result is always the same.
Where's the mistake?
Thanks!
Code:

#include <18f2550.h>
#fuses HS,NOWDT,NOPROTECT,NOPUT,NOLVP,NOMCLR
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7,ERRORS )

void main()
{
printf("\f");

while(1){
   delay_ms(500);
   printf("testing  ");
   }
}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jul 03, 2009 1:36 pm     Reply with quote

1. Read the markings on the crystal. Is it really 4.000 MHz ?

2. Make sure you re-compiled the program and re-programmed it into
the PIC, after making changes.

3. Check the settings on HyperTerminal. Make sure it's set for
9600 baud, No parity, 8 bits, 1 stop bit, and No hardware or software
handshaking. Or try a different Terminal progam, such as TeraTerm:
http://www.ccsinfo.com/forum/viewtopic.php?t=39388&start=18

4. Do you have a MAX232-type chip between the PIC and the PC ?
Did you build the board and the serial cable yourself, or did you
buy them ? If you built them yourself, then check for wiring errors.
hexfet13



Joined: 03 Jul 2009
Posts: 8

View user's profile Send private message

PostPosted: Sun Jul 05, 2009 4:19 am     Reply with quote

Thanks for reply.
I've solved the problem: the guilty was a spike upon Vcc caused by max3232.The amplitude of it was over 1.5V and the result was a dead pic that work at irregular intervals.
Thanks again.
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