| View previous topic :: View next topic |
| Author |
Message |
scanan
Joined: 13 Aug 2004 Posts: 88 Location: Turkey
|
| RS232 setup_uart |
Posted: Wed Jul 01, 2026 7:55 am |
|
|
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
|
|
Posted: Wed Jul 01, 2026 12:12 pm |
|
|
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
|
|
Posted: Thu Jul 02, 2026 4:33 am |
|
|
| 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
|
|
Posted: Thu Jul 02, 2026 6:01 am |
|
|
| Just curious as to why you want/need to do this..... |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 20108
|
|
Posted: Thu Jul 02, 2026 11:24 pm |
|
|
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
|
|
Posted: Mon Jul 06, 2026 5:10 am |
|
|
| 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
|
|
Posted: Mon Jul 06, 2026 12:54 pm |
|
|
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
|
|
Posted: Tue Jul 07, 2026 5:50 am |
|
|
| 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. |
|
 |
|