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 support@ccsinfo.com

USE RS232

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



Joined: 05 Aug 2014
Posts: 21

View user's profile Send private message

USE RS232
PostPosted: Fri Jul 26, 2019 1:34 am     Reply with quote

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

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

Re: USE RS232
PostPosted: Fri Jul 26, 2019 3:31 am     Reply with quote

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: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jul 26, 2019 4:32 am     Reply with quote

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