View previous topic :: View next topic |
Author |
Message |
Kwaku
Joined: 02 Jul 2020 Posts: 1 Location: Student
|
rs485 one master multislave communication |
Posted: Thu Jul 02, 2020 10:36 pm |
|
|
Can someone please provide me with a sample code for one master multiple slave code ? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9241 Location: Greensville,Ontario
|
|
Posted: Fri Jul 03, 2020 4:21 am |
|
|
CCS provides the 'drivers' for RS485 as well as an example. Located in the EXAMPLES folder.
As to how you use RS485, that's really up to you to decide. It's been around for at least 3 decades and there are 1,000s of ways to cut code for one master- several slaves.
Start with a master and ONE slave, be sure the hardware conforms to the RS485 standard, then get them to work 100%. Once that works THEN add one more slave, get that system working, then add another slave......
Do NOT start with a system with 20 or 64 or 100 slaves ! |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Sun Jul 05, 2020 12:15 am |
|
|
temtronic wrote: | Do NOT start with a system with 20 or 64 or 100 slaves ! |
Aww... Where's your sense of adventure!?!?
_________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9241 Location: Greensville,Ontario
|
|
Posted: Sun Jul 05, 2020 4:36 am |
|
|
well... back in the dinosaur days of hardcopy databooks and dialup modems, MaximIC sent me 200 sample pieces of the 'new' MAX487 so I could PROVE you could have 128 slaves on a bus....
... it took a week and LOTS of pots of coffee but.. yes, thier claim was TRUE. Over a 1,000' of wire with dozens of slave 'modules' ,here, there, everywhere.
I swear they were breeding overnight,as there had to be more than 128 on the bus!
The test lasted for about week and of course proved the weakness of all serial busses like RS485, RS232, one-wire, etc. namely cut one wire and it's dead. I've only found one viable option for that 'problem' and it's been rockstable for 3+ decades. |
|
|
|