Author Topic: data bus between modules  (Read 1865 times)

0 Members and 1 Guest are viewing this topic.

Offline alireza7Topic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: us
data bus between modules
« on: December 12, 2017, 05:59:55 pm »
hi
i want to design a product which contains different modules.
 i want to design each module in a separate pcb layer and finally pcb layers will Put together like floors of a building and they connect to each other by pin headers.

my design have a main pcb contains a main micro controller that manage the whole system.
in each module there exist a micro controller which have data exchange with the main micro controller and also manage the work of module.
for example one of the modules contains a sim800 and take care of send and receive sms.

how should i manage data exchange between modules? what data bus is the best solution? i2c? spi? any ic sugestion for driveing data bus?
my final product should pass Electostatic discharge  , Radiated electromagnetic field , Conducted electromagnetic
field , ...  and various environmental tests.
my final product should be capable of adding an other module in future easily.
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2332
  • Country: 00
Re: data bus between modules
« Reply #1 on: December 12, 2017, 06:09:10 pm »
What will be the speed / bandwidth  you will need, To you want to minimize wires or get more bandwidth, It's crucial to explain what is the kind of boards, it's to generic to any help
 

Offline alireza7Topic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: us
Re: data bus between modules
« Reply #2 on: December 12, 2017, 06:22:34 pm »
i want to assign  maximum 5 pins
minimum required speed 28.8 kbps
it is sufficient if at a moment just two modules be capable of communicating with each other.
« Last Edit: December 12, 2017, 06:24:11 pm by alireza7 »
 

Offline alireza7Topic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: us
Re: data bus between modules
« Reply #3 on: December 12, 2017, 06:26:33 pm »
also i'm not sure but i think it is better to have just a single master which is the main micro controller and other sub modules be slave
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2867
  • Country: us
Re: data bus between modules
« Reply #4 on: December 12, 2017, 11:47:14 pm »
28kbps is pretty slow.  Just about anything could manage that.

Does 5 pins include power, or you have 5 signal pins available? 

Full duplex UART would be only two pins, but would require that all devices agree on a baud rate.  A clocked interface might be better, because if you later decide you need more throughput you won't have to go changing baud rates everywhere.  It also means you could more easily get by without crystals on some of the sub boards.  That means USART, SPI, and I2C are options.  All will fit into five pins easily, but wouldn't leave you enough pins for discrete chip select lines, so you will have to have some sort of addressing mechanism built into your protocol.  I2C has this by default, so that's a point in its favor, but depending on the overall system size and number of devices, it may be challenging to get it working at higher speeds.  SPI or USART would be somewhat easier in this regard since they're actively driven from both ends.  SPI has an advantage in that the CS signal provides an inherent frame delimiter, so you can use that to allow your slave devices to identify the beginning and end of a message easily.  With a USART you'd have to include either a separate framing signal (at which point you basically have SPI), or define a packet format that includes some sort of frame delimiting, or use a break signal or timeout to delimit packets.

A one master/many slaves approach is definitely simpler.  Multi-master systems are possible, but you have to have some sort of bus arbitration system to resolve situations where two masters try to take control of the bus at the same time.  A single master system does require that the master poll all of the slaves for status changes, so it would be a good idea to include an interrupt line so that slaves can signal when they need the master's attention.
 

Online Jeroen3

  • Super Contributor
  • ***
  • Posts: 4598
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: data bus between modules
« Reply #5 on: December 13, 2017, 10:53:54 am »
my final product should be capable of adding an other module in future easily.
You can use a multi master bus like CAN bus, RS-485.
But you will need a way to detect the address/number of each device if you want multiple of the same device on the bus. One way to do this would be to use one connector pin and put a small resistor on it.
master - R1 - R2 - R3 - R4 - R5 - terminator.

For I2C you could use this as well to determine each board address.
I'm sure there are others ways as well.

Other way would be to use a serial protocol, like spi, and daisy chain all modules. However, this could get slow.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->