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

Software serial disable ?

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



Joined: 25 Oct 2004
Posts: 136

View user's profile Send private message

Software serial disable ?
PostPosted: Thu Dec 17, 2015 1:37 am     Reply with quote

Hello friends

I have to use the Software Serial unit from the ccs compiler, which works already very fine !

BUT I also have to make it configurable in that way, that I have to be able to disable it and use this port pin for other functions !

Is there a clean way to disable the soft serial at run time ?

Any help appreciated.

best regards
Andreas
Ttelmah



Joined: 11 Mar 2010
Posts: 19503

View user's profile Send private message

PostPosted: Thu Dec 17, 2015 2:17 am     Reply with quote

Just use the pins.

The software serial does nothing 'to' the hardware. It only acts on the pins when you use it. You can drive the pins just as normal.
It only reads the RX pin, when you do a kbhit, or a getc, and only writes to the TX pin when you do a putc.
Andreas



Joined: 25 Oct 2004
Posts: 136

View user's profile Send private message

PostPosted: Sun Dec 20, 2015 8:45 am     Reply with quote

Hello Ttelmah

Thank you for the clarification, but I had the impression, that if I leave the Set Statement in , then i see some little distortion on an regular timer Interrupt which seems to go when removing the set Statement !?

I am not sure if this a correct impression.

Best regards
Andreas
Ttelmah



Joined: 11 Mar 2010
Posts: 19503

View user's profile Send private message

PostPosted: Sun Dec 20, 2015 9:05 am     Reply with quote

'Set statement'?.

The only time #USE RS232 for a software unit has any effects on interrupts, is if you are configuring it to use an external interrupt, and enabling receive buffering, or if you select the 'DISABLE_INTS' option, and then only during the actual data transmission/reception. Or (of course), the 'old one' of having a putc/getc, both inside and outside an interrupt, when you will get the compiler warning 'interrupts disabled to prevent re-entrancy'.
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