Forums

Project using system bus (like I2C) VS project without any system bus

Started by Max_01 5 months ago5 replieslatest reply 4 months ago85 views

Hi everyone !

I'm new to embedded systems domaine and I have this question; if we don't use any system bus in a radar project that is based on PIC microcontroller for example, and we just do the wiring of the components, is that okay ? or will cause some loss data ? Otherwise, is the use of a system bus such as I2C is necessary for embedded system project ?

[ - ]
Reply by matthewbarrFebruary 14, 2020

Based on the devices you connect to your microcontroller, you either need a serial interface or you don't.

You typically use SPI or I2C to communicate (configure, control, transfer data) with an IC (eg. a flash memory device) that supports or requires that interface. If none of the external devices in your system support or require a serial interface to use them, there is really no reason for you to include one.

Even if you don't require a serial interface, you might consider bringing serial bus signals out to test points so they are accessible. Also include pads for any required pullup resistors. This way if you find you need to add a device that requires a serial interface, you can blue-wire your device connections and evaluate before changing your board design.

[ - ]
Reply by Max_01February 14, 2020

So it totally depends on the external devices of my system !

Thank you so much for your explanation matthewbarr.

[ - ]
Reply by PedroMBMachadoFebruary 15, 2020

Hi @Max_01,

   Not sure, why you mentioned "radar project" at all. The concept is simple microcontroller take inputs from sensors and provide outputs to actuators/display. Now, each sensor/actuator/display follow a communication protocol which might be either analog or digital. Analog devices will be interfaced either built-in or external ADC/DAC.

Low speed protocols which include UART (asynchronous full-duplex serial), i2c (synchronous half-duplex serial) and SPI (synchronous full-duplex serial) are used to communicate with the devices. Now, you will have to check that the TTL is compatible between devices (i.e. both the uC and device must use the same logic level, e.g. 5V or 3.3V). You will have to use level shifters if the TTL is not the same.

Now your questions are not clear. Loss of data happen when the transfer or sample rates are lower than the data generation rate (i.e. the amount of data being generated per unit of time). The selection of the communication protocol will have to take the data generation rate into consideration.

Kind Regards,

Pedro

[ - ]
Reply by Max_01February 29, 2020

Hi Pedro ! Thank you for your explanation,

Sorry if I didn't clarify enough my question, I'm new with all these concepts. 

I mentioned the "project radar" because in some tutorials they don't talk about bus system at all, they just do the wiring thing and everything works good. My question was, in this case, which communication protocol is used ? And you answered that I think, it's analog or digital communication, Am I right ?

[ - ]
Reply by CustomSargeMarch 12, 2020

Howdy, it seems you're trying to be specific without any details. It's overall more general - specific is totally case by case. In agreement with other posts, here's my summary.

Any connected device has some function - input, output or both. How it's controlled and does data transfer (if applicable) will be either analog or digital signals.

If analog, what voltage range and current will you have to "read" or drive.

If digital, are there simple signal lines and/or lines for data that use a protocol.

The mix of devices dictates the control and transfer software you'll have to write. Many microcontrollers have "blocks" to do common support - I2C, SPI, UART etc, and they're great. But I'll suggest to really learn a protocol, write your own. It's laborious and frustrating, but you'll Know it when done and will serve you well when wrangling a block that just doesn't behave the way you expect.  My $.02   Good Hunting  <<<)))