From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set the SCLK & SDO lines low...

Using a USB-8451 and need to set both the SCLK & SDO lines low as part of a prefix packet that I am sending to a device.  how do I do it in LabView?

 

I can set the SCLK low using the 0 (Idle Low) input to the 8451 Config Property node but am not sure how to set the SDO low as needed.  

 

 

0 Kudos
Message 1 of 13
(4,272 Views)

I used to have an 8451, but I don't anymore.  I don't have the drivers anymore either.  But isn't there a property node that lets you write a 1 or a 0 to the SDO line?  I'm sure there is one.  If not, then simply send a data byte of 0.

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 13
(4,265 Views)

from what I can tell on the scope, as soon as I send data out the clock line toggles per the setup VI configuration.  Its almost like it needs to be Anded with an active low CS line

0 Kudos
Message 3 of 13
(4,254 Views)

Yes when you send a data byte, even a 0, the clock line will toggle.  So that won't work.  Have you not found a property node to set the SDO line?

- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 13
(4,252 Views)

No, the only properties available in the config are CS, Clk rate, clk  polarity, clk phase & port.   Then on the 845x device property node all properties are dealing with the DIO port.  I have found only 2 property options for the 8451 and I do not see anything on the pallet.

0 Kudos
Message 5 of 13
(4,243 Views)

Isn't the SDO line low when you start it up?  How about before you call the first Initilization vi?  What state is it in after initialization?  I would think that both the SCLK adn SDO lines default values at start up would be low.  You are using SPI aren't you, not I2C?  With SPI, the lines are called SCLK, SDI, SDO, CS.  With I2C, the lines are SCK and SDA, and those start up high because of the start bit requirements for I2C.  The only start requirement for SPI is to set CS low, so CS default is high.  Both SCLK and SDO should be low upon startup.  SDI should be tristated.

- tbob

Inventor of the WORM Global
0 Kudos
Message 6 of 13
(4,231 Views)

It was initially low when I 1st started looking at it, once I ran an example program and monitored the output the line defaults to a high state when in-active.   I need to be able to form a data packet that has both lines low for greater than a defined time-out period, then the header, then the data.  If I write 0's then the clock cycles and the data is aligned either on the rising or falling edge depending on the config and the prefix criteria is not met.

 

Yes it is SPI.  The device is an MB16024 LED driver from Macroblock.

 

maybe I cannot use the 8451 for this task??  ...  Smiley Surprised

 

 

0 Kudos
Message 7 of 13
(4,226 Views)

What if you wrote a dummy program just to write a zero byte?  Then when the program ends, do both lines stay low?  Then call your real program.  Do both lines stay low until you write your first byte?  Or do the lines go high when you initialize the device?  At the end of your code, always end the output with a low.

- tbob

Inventor of the WORM Global
0 Kudos
Message 8 of 13
(4,221 Views)

 


@steve05ram360 wrote:

 

Yes it is SPI.  The device is an MB16024 LED driver from Macroblock.


 

Are you actually referring to the http://www.mblock.com.tw/products_mbi6024.html? (Note the "I" instead of the "1") Where does it say it's a SPI device? I don't see it saying SPI anywhere on that page. Do you have the actual datasheet? I was unable to find it on their web site.

 

 


  maybe I cannot use the 8451 for this task??  ...  Smiley Surprised

You can always use bit-banging mode.

 

0 Kudos
Message 9 of 13
(4,219 Views)

Yes I have the full data sheet, quoted from the data sheet " MBI6024 adopts the SPI-like interface (CKI/SDI).  By SPI-like interface, MBI6024 samples the data (SDI) at the falling edge of the clock (CKI)...."  It goes on to show an example of the 2 waveforms.

 

 

"You can always use bit-banging mode."  < do you mean hammer it out using 2 DIO pins?

 

the simplest fix is to just use the hardware I'm trying to eliminate...  I already have that working, just trying to speed it up since we have allot of testing to do in a short amount of time.

 

0 Kudos
Message 10 of 13
(4,211 Views)