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

RS-232 TX Problem

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







RS-232 TX Problem
PostPosted: Mon Jul 14, 2003 11:21 am     Reply with quote

Hi
I just upgraded to the latest compiler available from CCS webpage.
The problem;
If I transmit a specific character over the RS-232 the pic (F877) crashes. Any other code transmitted is ok.

Example of Basic problem
a = 0x10 ;
putc(a) ; //No Problem the thing works

a = 0x05 ;
putc(a) ; //The program crashes.

I have removed all other code from the program which is very big and only have the RS-232 section working and everytime the code is 0x05 the pic crashes.

Hope somebody can help, I am very frustrated and the deadline is upon me.
Regards
Piet
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515958
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

Re: RS-232 TX Problem
PostPosted: Mon Jul 14, 2003 11:46 am     Reply with quote

:=Hi
:=I just upgraded to the latest compiler available from CCS webpage.
:=The problem;
:=If I transmit a specific character over the RS-232 the pic (F877) crashes. Any other code transmitted is ok.
:=
:=Example of Basic problem
:=a = 0x10 ;
:=putc(a) ; //No Problem the thing works
:=
:=a = 0x05 ;
:=putc(a) ; //The program crashes.
:=
:=I have removed all other code from the program which is very big and only have the RS-232 section working and everytime the code is 0x05 the pic crashes.
:=
:=Hope somebody can help, I am very frustrated and the deadline is upon me.
:=Regards
:=Piet

The biggest difference in those numbers is how many consecutive zero bits follow the start bit in the byte transmition. How accurate is your clock and baud rate?
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515959
Sherpa Doug
Guest







Re: RS-232 TX Problem
PostPosted: Mon Jul 14, 2003 12:00 pm     Reply with quote

:=The problem;
:=If I transmit a specific character over the RS-232 the pic (F877) crashes. Any other code transmitted is ok.
:=
:=Example of Basic problem
:=a = 0x10 ;
:=putc(a) ; //No Problem the thing works
:=
:=a = 0x05 ;
:=putc(a) ; //The program crashes.
:=

What do you mean by "crash"? Does the processor reset? Does the clock keep running? Does it crowbar the power supply?

___________________________
This message was ported from CCS's old forum
Original Post ID: 144515960
John Taylor
Guest







Re: RS-232 TX Problem
PostPosted: Mon Jul 14, 2003 12:21 pm     Reply with quote

Chr 0x05 is an ENQ, is it possible that you are getting an immediate response from the other side of the RS232 connection that you don't expect? If you transmit with an interrupt handler, a new character into your input buffer could overrun your hardware receive buffer (Because you don't process it) and make all other reception impossible until the error is cleared.

//Check status of bit oerr once "Crashed" in 16F877:
#byte rcsta=0x18 //UART overrun error control variables
#bit cren=rcsta.4 //adjust addressing for processor
#bit oerr=rcsta.1

//If oerr is high, it can only be cleared by toggling cren...
//-----------------------------------------------------------
//overrun error clearing, perform every system loop -
//-----------------------------------------------------------
if (oerr) //if overrun is true
{
cren=false; //toggle rcsta, cren bit to clear
cren=true;
}
//-----------------------------------------------------------


:=:=Hi
:=:=I just upgraded to the latest compiler available from CCS webpage.
:=:=The problem;
:=:=If I transmit a specific character over the RS-232 the pic (F877) crashes. Any other code transmitted is ok.
:=:=
:=:=Example of Basic problem
:=:=a = 0x10 ;
:=:=putc(a) ; //No Problem the thing works
:=:=
:=:=a = 0x05 ;
:=:=putc(a) ; //The program crashes.
:=:=
:=:=I have removed all other code from the program which is very big and only have the RS-232 section working and everytime the code is 0x05 the pic crashes.
:=:=
:=:=Hope somebody can help, I am very frustrated and the deadline is upon me.
:=:=Regards
:=:=Piet
:=
:=The biggest difference in those numbers is how many consecutive zero bits follow the start bit in the byte transmition. How accurate is your clock and baud rate?
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515964
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