background image

DOC: SPII2CHDWBrief - V2.71    07/25/2017 

 

PAGE 4 

NOTICE 

 
 

Important Notice: 

 

LadyBug LB5900 Devices operating in SPI and I2C modes differ in several ways from traditional 
SPI & I2C devices. It is important to understand some of these differences to have a successful 
implementation of the system. 

 

Due to familiarity to memory and other chip based devices, the user may expect the response 
time to be the same after each request. The LB5900 Sensor’s SPI & I2C engine is dependent on 
the sensor’s primary processor. The time required for each request will vary significantly with the 
request. Further, the time required to make measurements may depend upon the power level 
and other factors.     
 
Sensor Firmware updates. When the sensor is updated, the time to process commands may 
change. Additional features may cause certain commands to require more time for completion, 
this includes existing commands that may appear to be unrelated.    
 
Adherence to the following list of recommendations will assure success. 
 

-

 

● 

Connect Pin 1, SPI/I2C Select, directly to power or ground. Do not connect it to a 

control line. This line is tested at power up only; and any startup glitches on the controller 
may cause erroneous selection that can only be cleared by power down.  
 

-

 

Prior to sending commands or queries, test the sensor to make sure it is ready. 
 

-

 

Adhere to the timing recommendations and do not clock data faster than the 
recommended rates, even though the sensor may perform well at faster rates and 
reduced setup times. This will assure that future firmware versions will operate properly. 
 

-

 

Do not test the sensor to determine if it is ready for a command or query faster than the 
recommended minimum time (1ms). Bear in mind that each request interrupts the 
processor to fulfil the request. 
 

-

 

Avoid unnecessary requests after sending measurement commands. For example if a 
measurement is expected to take 100ms, request readiness after 90ms, or at 5 or 10ms 
rather than 1ms.  
 

-

 

If a measurement is in process, do not send the sensor anything other than a test to see if 
the measurement is complete or to send 

a DCL command. 

 

-

 

Read the REVISIONS & UPDATES Section each time this manual is updated. Important 
changes are marked with 

● 

or 

 

 

 

Summary of Contents for LB5900 Series

Page 1: ...ion Port Reset 6 Wiring Diagram Connector Pin Out 7 USING I2C 8 Electrical Data Connection and Addressing 8 I2C Message Overview 9 Processing Time Delay 9 Clock Start Stop Direction 9 Acknowledge NACK...

Page 2: ...ommand Header 23 Previous SPI communication status 23 Busyness 24 Busy Ready 24 Sensor Status Byte STB 25 Measurement Processing Time 25 Header Details 25 Command Header 06h Read Status Length 26 Comm...

Page 3: ...14 Figure 11 ACK NACK Tests 15 Figure 12 Header 06h with Command Example 16 Figure 13 Header 06h used to Prepare Status Length 17 Figure 14 Read the Status and Length 18 Figure 15 Command Header 0Ch E...

Page 4: ...ect Pin 1 SPI I2C Select directly to power or ground Do not connect it to a control line This line is tested at power up only and any startup glitches on the controller may cause erroneous selection t...

Page 5: ...ffer option SPI the option enables sensor operation through SPI Serial Peripheral Interface or I2C Inter Integrated Circuit Each interface technology has its own advantages LadyBug recommends that the...

Page 6: ...ed later may be in binary form In general SCPI commands sent USB I2C or SPI are identical There are however some exclusions and limitations The SPI and I2C interfaces do not accept concatenated comman...

Page 7: ...or With option SPI a standard USB cable can also be connected and the sensor will function as a USB sensor when SPI is not enabled The SPI I2C connector end is a Samtec FFSD type or equivalent keyed 0...

Page 8: ...yBug s nominal recommended value is 2 2K ohms The pull up resistors should be connected to the microcontroller s logic power supply 3 3 5 0 volts near the microcontroller High speed applications may b...

Page 9: ...stop conditions are always generated by the master user controller After a start condition is issued the bus is considered to be busy and cannot be used for any other transactions until a stop condit...

Page 10: ...ed and responds with ACK it is ready for a request if NACK is returned the master should wait A loop can be setup and continuous tests made until ACK is returned I2C Timing I2C timing conditions are s...

Page 11: ...R W All messages begin by the user master issuing a standard I2C start condition and terminate with a standard I2C stop condition Each byte must be acknowledged by the receiver of the data The figure...

Page 12: ...s ignored by sensors without matching addresses LadyBug utilizes I2C standard 7 bit addressing with bits 7 3 set as 10011 followed by two bits for sensor addressing then the direction bit as detailed...

Page 13: ...The primary bit used is bit 4 which indicates that a message is available The message can be the measurement an error message or other information Figure 9 Status Byte Details It is important to note...

Page 14: ...he indicated command Figure 10 I2C Command Header Table Note that reading data back from the sensor is done following one of the above commands and is detailed below with each command header explanati...

Page 15: ...an error when it is not sent Figure 11 ACK NACK Tests The list below details how to use ACK NACK for testing At the end of this section is a complete measurement example ACK NACK should be utilized pr...

Page 16: ...ed by hardware to determine the addressed sensor If only requesting the sensor status and the length of any available data no SCPI command or terminator is sent Direction address byte R W bit 0 Output...

Page 17: ...ta is known Header 0Ch Read Complete Output Buffer can be used to read in the data Using the Prepare Status Length alone without a command is normally not required since the number of bytes available...

Page 18: ...can be done after sending Header 06H and receiving ACK Normally if sent with no command the length of available data will be 0 and only the status byte is useful Figure 14 Read the Status and Length...

Page 19: ...to sensor Start condition Address byte 0Ch Stop Condition Figure 15 Command Header 0Ch Example Read Complete Output Buffer is designed to pass the entire buffer back Any data left in the sensor output...

Page 20: ...st for ready see below 8 Write FREQ 1000 MHZ use your frequency to sensor using Header 06h then wait 1ms Sets the measurement frequency 9 Test for ready see below 10 Write AVER COUN 10 use your of ave...

Page 21: ...same name For example the output of the master must always be connected to the input of the slave This line is called MOSI Master Out Slave In The master s input is MISO Master In Slave Out Some micro...

Page 22: ...gure 18 which details the sensors CPOL 1 and CPHA 1 SPI timing The clock is always generated by the master user controller and both the master and sensor capture data on the trailing clock edge The da...

Page 23: ...ller is required to allow sufficient time for the sensor to process the function prior to requesting data During the time the sensor is processing data the master can address other sensors For example...

Page 24: ...ed Figure 22 Byte Timing Diagram and Table Processing begins when the SS line is raised after a command is received from the master user controller During processing the sensor has limited capability...

Page 25: ...r contains a message 5 32 Event Status Bit Future implementation 6 64 Master Summary Status Future implementation 7 128 Status Summary Future implementation Figure 23 Sensor Status Byte Measurement Pr...

Page 26: ...e and the command will function as expected This is separate from the Sensor s measurement completion flag Measurement completion is indicated by bit 4 of the status byte however this byte is not vali...

Page 27: ...Header F0h The length of Command Header F0h is dependent on the command being sent however the minimum is 5 bytes including the message terminator The minimum 5 bytes including the terminator is only...

Page 28: ...st generate the required clocks This is done by sending irrelevant data to the sensor Figure 26 Command Header 0Ch Read Back Example Prior communication indicated that there are 16 bytes 010h availabl...

Page 29: ...delay 3 INIT CONT 0 Sets the sensor for single triggered measurements 4 AVER COUN AUTO 0 Turns off automatic averaging 5 FREQ 1020 MHZ Sets the frequency 6 AVER COUN 10 Sets Averaging to 10 7 READ Ma...

Page 30: ...d Length Loop refer to the READ Command at the end of this section 2 TRIG DEL AUTO 0 Turns off Trigger delay To the sensor F0000010TRIG DEL AUTO 000 At this point a 1ms delay can be added or a Read St...

Page 31: ...n the controller program because it is known that the measurement will take at least that long Now test the sensor to see if the measurement is complete To the Sensor 060000000000 Send all 6 bytes Ret...

Page 32: ...I E0 06 00 00 00 00 00 READ STB AND LENGTH FF E0 00 00 00 00 BUSY SPI E0 STB 00 BUFFER EMPTY 06 00 00 00 00 00 READ STB AND LENGTH FF E0 00 00 00 00 BUSY SPI E0 STB 00 BUFFER EMPTY 06 00 00 00 00 00 R...

Page 33: ...on Pages 28 27 24 21 Document Revision V2 5 Clarification regarding SPI I2C Selection during Startup Important changes marked with on Pages 4 6 Document Revision V2 6 Document Minor text changes Docu...

Reviews: