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

Undefined identifier: rs232_errors

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



Joined: 13 May 2004
Posts: 90
Location: Nashville, TN

View user's profile Send private message Send e-mail Visit poster's website

Undefined identifier: rs232_errors
PostPosted: Thu May 12, 2005 2:11 pm     Reply with quote

Can anyone get this code to compile in 3.224 without the compiler complaining that rs232_errors doesn't exist?

Code:
#include <18F4620.h>
#device ICD=TRUE
#fuses intrc,nowdt,nobrownout,nolvp,noprotect
#use delay(clock=8000000)
#use rs232(baud=9600, xmit=PIN_A0, rcv=PIN_A0, ERRORS, stream=asdf)
void main() {
   while(1){
      output_high(PIN_A0);
     
      rs232_errors = 0;

      fprintf(asdf, "HELLO WORLD");
      delay_ms(1000);
   }
}


--
Jeff S.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu May 12, 2005 2:17 pm     Reply with quote

Wasn't all of this gone over back in March ?
http://www.ccsinfo.com/forum/viewtopic.php?t=22342&highlight=rs232errors
In fact, this was your thread.
object01



Joined: 13 May 2004
Posts: 90
Location: Nashville, TN

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu May 12, 2005 2:23 pm     Reply with quote

PCM programmer wrote:
Wasn't all of this gone over back in March ?
http://www.ccsinfo.com/forum/viewtopic.php?t=22342&highlight=rs232errors
In fact, this was your thread.


Different chip, different month, different compiler version. New question. :)

It may have been my thread, but it was an unrelated problem. The last thread was about the compiler complaining that the variable was never used. Now it's complaining that it doesn't exist.

--
Jeff S.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu May 12, 2005 2:54 pm     Reply with quote

I think it's because you've defined a software UART.
The RS232_ERRORS variable is only available under limited
circumstances with a soft UART. Here's what the manual says:
Quote:

The definition of the RS232_ERRORS is as follows:
No UART:
• Bit 7 is 9th bit for 9 bit data mode (get and put).
• Bit 6 set to one indicates a put failed in float high mode.
With a UART:
• Used only by get:
• Copy of RCSTA register except:
• Bit 0 is used to indicate a parity error.

It would be more clear if they had stated it as "No Hardware UART" and
"With a Hardware UART".

So if you modify your declaration of a software UART so that it uses
9 bits, then the compiler will create the RS232_ERRORS variable,
and you won't get the error. Example:
Code:
#use rs232(baud=9600, xmit=PIN_A0, rcv=PIN_A0, ERRORS, bits=9, stream=asdf)
Tom Jetland



Joined: 23 Jun 2011
Posts: 31
Location: UK

View user's profile Send private message

PostPosted: Wed Jul 02, 2014 10:01 am     Reply with quote

Also the reason this error will occur is if you haven't specified the correct UART Hardware pins!

Make sure you change these when porting code from one Pic to another!!

Tom
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Wed Jul 02, 2014 10:25 am     Reply with quote

Tom,

Do you realize that you are replying to a 9 year old thread? Doubtful this is still an issue for the OP. They have either solved it by now, or given up!

IMHO, it's a bad idea to resurrect these 'zombie threads'......

Just sayin'

John
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