Many of us start our digital sensor projects with the hopeful assumption that "all I need to do is hook up some wires and write some code." Sometimes, it really is that easy. Connector pin assignments between the sensor and processor board match, example code provides the necessary protocol and we are off and running that afternoon. However, we often find that there is a lot more to developing reliable communications between a sensor and a master system processor. Here is a quick list of things that can delay our success in our sensor integration work, using the SPI interface on a MEMS IMU as our object lesson. Some of them are directly influenced by code, others are not. Successful integration requires that all of these needs be met.
- Power Supply: All digital mixed signal devices have switching noise and some sort of transient current demands during start-up. Make sure the power conversion devices can meet these needs and make sure that the delivery of this power (between converter and sensor) doesn't introduce unnecessary impedance or change the transient responses of the system. Assume that you can just hook any +3.3V source up to your sensor at your own peril! Here are some simple things to observe, which can help assure that the devices are not being impeded by inadequate power supply service:
- Measure the sensor's supply current: This can often be observed on bench-top power supplies (if the DUT can be easily isolated). With appropriate care for the voltage drop at the DUT, this can sometimes come from a voltage measurement, across an in-line resistor. The key thing is to understand the accuracy/repeatability of your measurement technique and then, within that error allowance: is the current measurement within the expectation for normal operation, per he datasheet? For example, the ADIS16375 datasheet lists a typical operating current of 173mA, but the devices will only draw ~24mA when the start-up transients or switching noise cause the VDD line to droop below +3V during start-up. Zero (or intermittent) current could be an indication of a poor connection.
- Measure the voltage/time profile during start-up. Use a single-event trigger on a digital scope for this. Do you see any droops, over-shoots or other strange behaviors during start-up?
- Correct Serial Interface Connections: Check for this in the sensor's datasheet. For a SPI, get used to seeing things like "master in, slave out" as MISO....Here is an example:
- Serial command structures: Things like bit order (MSB or LSB first?), addressing and distinguishing between a read and a write are all important. Looks for diagrams like this to help:
- Clock, phasing and timing: Again, check the datasheet for timing diagrams and tables of information that might be helpful:
- Physical connections: Does your setup look like a rat's nest of wires or have you run twisted pairs (one signal/one ground) for each sensitive signal through the shortest distance possible?
- Signal integrity: Ringing, random spikes, persistent noise, low signal strength are all things that often need careful probing with an oscilloscope for troubleshooting when their are unexpected results. Use stable test patterns to study signals and make sure there is no opportunity. Here is an example test pattern:
I hope that this helps! Remember, it takes more than a few lines of code to assure reliable digital communications.