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

#use rs232 question.

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



Joined: 20 Sep 2003
Posts: 47
Location: Brussel - Belgium

View user's profile Send private message

#use rs232 question.
PostPosted: Tue Jun 07, 2005 3:18 am     Reply with quote

With my 16F876A I use two serial port. The first one is the internal UART (C6 and C7) and works great.
The second one is initialized like as follow :
Code:
#use rs232(baud=4800,parity=N,xmit=PIN_C0,rcv=PIN_C1,stream=GPS,errors)

After, in the main, in function of the state of an input port, I wish change the option of this port. Only add INVERT.
The help file say : "Invert : not be used with the internal UART."
The compiler don't give error, but when I read the lst file I don't see any code for this modification.
Code:
....................    if (cGPSinv == 1)       // GPS TTL inverse
0504:  DECFSZ 5C,W
0505:  GOTO   506
....................       {
....................       #use rs232(baud=4800,parity=N,xmit=PIN_C0,rcv=PIN_C1,stream=GPS,errors,invert)
....................       }
....................
....................    if (cI2C == 0)   // mode RS232
0506:  MOVF   3D,F

Could you me say where is my error ? Thanks a lot.
(I use PCWM 3.217)
Ttelmah
Guest







PostPosted: Tue Jun 07, 2005 6:37 am     Reply with quote

Just define another stream.
So:
Code:

#use rs232(baud=4800,parity=N,xmit=PIN_C0,rcv=PIN_C1,stream=GPS,errors)
#use rs232(baud=4800,parity=N,xmit=PIN_C0,rcv=PIN_C1,stream=GPSI,errors)


When you want to use the inverted form, select 'GPSI', instead of 'GPS'.

The 'stream' parameter, really makes the use of inline #use defintions obsolete, and many now seem to give problems. It seems that the default for the inline version, is to only work without the stream parameter, and to always replace the current stdio. Presumably the compiler is seeing the hardware port as being the current stdio port, so errors when it sees this trying to be changed...

Best Wishes
GDetienne



Joined: 20 Sep 2003
Posts: 47
Location: Brussel - Belgium

View user's profile Send private message

PostPosted: Tue Jun 07, 2005 2:54 pm     Reply with quote

Thanks for your suggestion.

Regard.
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