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

RS232 setup_uart

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



Joined: 13 Aug 2004
Posts: 88
Location: Turkey

View user's profile Send private message Visit poster's website

RS232 setup_uart
PostPosted: Wed Jul 01, 2026 7:55 am     Reply with quote

HELLO,
I want to set ON or OFF rs232 at run time
I was checking the user manual of ccs compiler
can' t find a clear descriyion,
how to do it?
cheers
_________________
Dr Suleyman CANAN
R&D Electronic Engineer
https://suleymancanan.wordpress.com

Do whatever you do with amateur spirit -
But always feel professional.
Ttelmah



Joined: 11 Mar 2010
Posts: 20108

View user's profile Send private message

PostPosted: Wed Jul 01, 2026 12:12 pm     Reply with quote

The syntax is pretty simple. Using stream names:

SETUP_UART(FALSE, STREAM_NAME); //turns the UART off

SETUP_UART(BAUD, STREAM_NAME); //turns UART on
scanan



Joined: 13 Aug 2004
Posts: 88
Location: Turkey

View user's profile Send private message Visit poster's website

PostPosted: Thu Jul 02, 2026 4:33 am     Reply with quote

Ttelmah wrote:
The syntax is pretty simple. Using stream names:

SETUP_UART(FALSE, STREAM_NAME); //turns the UART off

SETUP_UART(BAUD, STREAM_NAME); //turns UART on


Many thanks Ttelmah
_________________
Dr Suleyman CANAN
R&D Electronic Engineer
https://suleymancanan.wordpress.com

Do whatever you do with amateur spirit -
But always feel professional.
temtronic



Joined: 01 Jul 2010
Posts: 9646
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Jul 02, 2026 6:01 am     Reply with quote

Just curious as to why you want/need to do this.....
Ttelmah



Joined: 11 Mar 2010
Posts: 20108

View user's profile Send private message

PostPosted: Thu Jul 02, 2026 11:24 pm     Reply with quote

There are quite a few situations where this is wanted.
There are some serial standards that require pulse sequences on a
serial line at very slow timings before the serial in sent. Difficult/impossible
with the UART. The old serial protocol for the keyboard on a PC is an
example of this.
Then things where different hardware configurations need the UART to be
moved.
Then ones where different signalling is used on the same lines. I have one
where at times the same lines have to be used for async serial and SPI
with different enables operated.
scanan



Joined: 13 Aug 2004
Posts: 88
Location: Turkey

View user's profile Send private message Visit poster's website

PostPosted: Mon Jul 06, 2026 5:10 am     Reply with quote

temtronic wrote:
Just curious as to why you want/need to do this.....

I upload some parameters by using an application from a PC to the PIC controller via RS232.
I put some authentication bytes etc... before uploading the data, but I observed that some parameters changed randomly when the device is connected to an industrial machine. I suspected that parasitic signal may overcome the autentication and accepted as normal data from PIC.
I decided to switch OFF rs232 after uploading data.
_________________
Dr Suleyman CANAN
R&D Electronic Engineer
https://suleymancanan.wordpress.com

Do whatever you do with amateur spirit -
But always feel professional.
Ttelmah



Joined: 11 Mar 2010
Posts: 20108

View user's profile Send private message

PostPosted: Mon Jul 06, 2026 12:54 pm     Reply with quote

The problem here is that this 'bodge' does not fix the problem. If
this noise happens while you ae transferring data, there is a real risk this will
be corrupted. Hopefully your protocol is designed to cope with this?
How is the connection actually done?. Signalling method?. Suppression?.
Termination?.
scanan



Joined: 13 Aug 2004
Posts: 88
Location: Turkey

View user's profile Send private message Visit poster's website

PostPosted: Tue Jul 07, 2026 5:50 am     Reply with quote

Ttelmah wrote:
The problem here is that this 'bodge' does not fix the problem. If
this noise happens while you ae transferring data, there is a real risk this will
be corrupted. Hopefully your protocol is designed to cope with this?
How is the connection actually done?. Signalling method?. Suppression?.
Termination?.


everything was working fine after uploading data. After few days of function , some data change. I just suspected it could be infiltrated from rs232 port.
The data are transferred via a piece of PC software that write myself.
the data is sent in intel hex forma. The pic check every crc for every line of hex lines.when all data is ok pic send data transferred correctly signal.

The data are written on some part of program memory data size about 2Kbytes.

"How is the connection actually done?. Signalling method?. Suppression?.
Termination?."
more details about these.
_________________
Dr Suleyman CANAN
R&D Electronic Engineer
https://suleymancanan.wordpress.com

Do whatever you do with amateur spirit -
But always feel professional.
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