|
|
View previous topic :: View next topic |
Author |
Message |
Nevillestone
Joined: 05 Aug 2014 Posts: 24
|
USE RS232 |
Posted: Fri Jul 26, 2019 1:34 am |
|
|
HI
I'm using a serial port for a 485 bus and using USE RS232 built-in function.
It works however I'm having to control the enable bit manually back to receive mode after transmitting.
Is there a setting to set it to RX Mode as default ? I can't find anything in the manual.
Using
Code: | #USE RS232 (baud=1200,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,stream=PORT1,enable=PIN_B2)
#define RS485_USE_EXT_INT TRUE |
Thanks
Neville _________________ Neville |
|
|
dluu13
Joined: 28 Sep 2018 Posts: 395 Location: Toronto, ON
|
Re: USE RS232 |
Posted: Fri Jul 26, 2019 3:31 am |
|
|
Nevillestone wrote: | HI
I'm using a serial port for a 485 bus and using USE RS232 built-in function.
It works however I'm having to control the enable bit manually back to receive mode after transmitting.
Is there a setting to set it to RX Mode as default ? I can't find anything in the manual.
Using
Code: | #USE RS232 (baud=1200,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,stream=PORT1,enable=PIN_B2)
#define RS485_USE_EXT_INT TRUE |
Thanks
Neville |
I know that the included modbus.c library will handle all that stuff automatically. There's also a rs485.c in the drivers folder, which I have never used. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9245 Location: Greensville,Ontario
|
|
Posted: Fri Jul 26, 2019 4:32 am |
|
|
I've always tied _RE and DE of the RS485 device together so that both pins were controlled as the 'ENABLE' pin in the USE RS232(....options...). Can't recall ever having a problem.
If you physically tie _RE low (to gnd), the RS485 receiver 1/2 will always be active, which means the PIC will see it's own transmitted data.
You need to cut a small program/compile and dump the listing to see what CCS does with the 'ENABLE' pin. I suspect it goes high, send data, goes low.
I'd do it but my manure spreader needs new beater bearings....
Jay |
|
|
|
|
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
|