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

Rs485 Wait_for_Bus

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







Rs485 Wait_for_Bus
PostPosted: Tue Jun 19, 2007 12:00 pm     Reply with quote

Hello all,

I have a ittle trouble with RS485, i would like to block RS485 transfer when i like. I mean not disable the RS485, but do something so that everybody on the RS485 line sees it has busy , so that when i use "wait_for_bus" everybody waits.

utils i decide to free it again.

I tryed to output_high(RS485_ENABLE_PIN) and RS485_TX_PIN


Code:
void rs485_wait_for_bus(int1 clrwdt)
{
   int16 i;

   RCV_OFF();
   for(i=0; i <= (rs485_wait_time*20); ++i)
   {
      if(!input(RS485_RX_PIN))
         i = 0;
      else
         delay_us(50);

      if(clrwdt)
         restart_wdt();
   }


any help ? or idear ?
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

Re: Rs485 Wait_for_Bus
PostPosted: Tue Jun 19, 2007 12:40 pm     Reply with quote

Dave Clark wrote:
any help ? or idear ?

A 485 Bus is not intended to be driven from more than one device at a time. You need a Protocol to keep this from happening.
Guest








PostPosted: Wed Jun 20, 2007 2:00 am     Reply with quote

first thx, for answer.
second, damn ....

is there a way to send a message to ALL id's ?
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Wed Jun 20, 2007 8:54 am     Reply with quote

It all depends on the protocol YOU write. RS485 just specifies the voltages on the wires, not the bits that go on them. If each node checks for a Stop bit condition before talking, and one node sets a Start bit condition and holds it, then everyone will eventually stop and stare at the line waiting for a Stop bit. Is this what you are looking for?
_________________
The search for better is endless. Instead simply find very good and get the job done.
Guest








PostPosted: Thu Jun 21, 2007 1:06 am     Reply with quote

yes this is something like this i was looking for. I forgot to say that i am using the RS485.c provided by CCS. I am going to take a look at modbus.c provided too.

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