USB-8451 SPI Read/Write MOSI

I have a USB-8451 that I am using for SPI communications. The USB-8451 is the master device, and I have no problem sending and recieving data. The problem is that I cannot send what I want to with the USB-8451. When I execute a read command for 16 bit data, the USB-8451 sends 0x0300. I need to send certain commands over SPI in order to get the correct response; ie - send 0x1000, 0x2000, 0x3000, etc. I have not found a way to do this, and it is very critical that I am able to for this project to work correctly. Any suggestions?  

Hello Johu,
The SPI Read Write vi has a data write input which takes in an array of bytes.  If you want to ONLY read 16 bit, you have to put an array of 2 bytes which are 0.  Since SPI is a full duplex protocol, it will send 0x00 0x00 and receive 16 bits at the same time.  
Usually, you send a command before reading.  So, you would send a total of three bytes, the first one being your command.  The first byte returned would not contain any data, since your device is reading the command.  The 2 last bytes would contain your data.  So:
Bytes Sent         Bytes Read
CMD                           0 (or should be 0)
0                                 Data1
0                                 Data2
You can download these test panels and try to using them to send your commands and read your data.  
Please let me know if any of this is not clear or if you need more help with this.  Have a great day.   
O. Proulx
National Instruments
www.ni.com/support

Similar Messages

  • USB-8451 SPI

    I have a an ADC chip want to control/acquire data using USB-8451 SPI/I2C module.
    I have setupped initial SPI settings (clock edge, polarity, speed etc).
    If i passed SPI command 3F; the ADC will output data continously...
    How can i read this data continously in LV8.5?
    how does the program looks like?
    I tried while loop. but in while loop I am continuously sending commands isnt it?.
    what is the best way to do?
    can some one help me on this?
    naushica

    Bonjour Jerome,
    Malheureusement, cette carte ne peut pas être utilisé en mode esclave.
    Concernant l'utilisation des signaux MISO et MOSI je pense que vous possédez déjà la doc de la carte. Sinon la voici :
    http://www.ni.com/pdf/manuals/371709b.pdf
    Par ailleurs, je vous invite à consulter cette article qui pourrait peut-être vous aider :
    http://zone.ni.com/devzone/cda/tut/p/id/8359
    N'hésitez pas à nous répondre si vous avez encore des questions en précisant quel logiciel vous utilisez (LabVIEW...) et avec quel microcontroleur vous souhaitez dialoguer.
    Cordialement
    Jean-Philippe
    Jean-Philippe C.
    National Instruments France

  • USB-8451 SPI interface with analog devices isensor

    Does anyone has example VI using USB-8451 with analog devices isensor? I am new to SPI interface and very slowly learning how to use labview in conjunction with USB-8451 to do SPI sensor reading.
    Any help would be appreciated. I'm using labview 8.5. 

    elpiar wrote:
    It's working!
    Well, I realized I made a small mistake in the example. The number of bytes in the array constant should be 4, not 2. The device is full duplex, meaning you can write and read from it at the same time. The NI-845x SPI Write Read VI returns the same number of bytes as the number of bytes that were written. Thus, with just 2 bytes you will not actually get the current value of the register. You would get the values from the previous command. See attached mod.
    Now if I read the data is burst mode, will the output be automatically be arranged in an array of 8-bit length words? You mention something about send out out 8 clock burst. I'm not sure how I do this. 
    For burst mode you have to send out more bytes so you get clocks generated for the read to occur. The burst mode command is 3E00. That needs to be followed by 12 16-bit numbers for the device to return all the registers from SUPPLY_OUT to AUX_ADC. The actual bytes after the 3E00 are irrelevant for a write. The NI-845x SPI Write Read VI should then return 26 bytes (2 bytes that line up with the 3E00 command, followed by 2 bytes per register, for 12 registers). You can convert this into an array of U16 values and do the conversions based on which register you're actually reading. I've attached a VI to get you started. The example converts the SUPPLY_OUT register and each of the GYRO_OUT registers. You can finish the VI. Note that you should make the 14-bit to 16-bit extension a subVI so you're not duplicating code. 
    NOTE: As with all example code that is provided you should verify that the numbers you get are correct. We don't have the hardware, so we can't verify correct operation. 
    Attachments:
    ADIS16400 XGYRO_OUT v2.vi ‏29 KB
    ADIS16400 Burst Read Example.vi ‏36 KB

  • USB 8451 SPI Communicat​ion

    Hi All,
    I am tring to write SPI 16 bits command to TI TLV5638 DAC.
    Labview examples are for 8 bits only. can anyone help me?
    Thanks,
    Eliran. 
    Message Edited by Eliran11 on 06-29-2008 02:44 AM

    Hi Eliran,
    The USB 8451 supports only 8 bit communication.
    This KB has a suggestion on how to implement 16 bit commands. "The approach you would take when writing or reading a 16 bit number is
    to write or read a byte array of length 2. You can use a Type Cast to
    convert back and forth between arrays of 8 bit integers and arrays of
    16 bit integers."
    Hope this helps!
    Warm regards,
    Karunya R
    National Instruments
    Applications Engineer

  • USB 8451-SPI AD7904

    Hi,
    I am using SPI 8451 Module to send commands to AD7904 (4 input multiplexer ADC).  
    I have set up the VI to read/write from 1 channel only. I have a constant voltage on my input but the read data is constantly varying. 
    i think the problem I am facing is that SPI 8541 can only write 8 bit word and I am writing 16 bit word to my AD7904.
    If someone knows how to make the usb spi 8541 to write/read 16 bit word, then my issue is resolved.
    Thanks
    Allan

    Hi,
      for 16 bit, it should be a case of writing / reading 8 bits twice so using the array of data itself..
    You may need to re-order the either the bit order, or the byte order to match you device though. You can split and join two 8 bit numbers from/to a 16 bit one using the inbuilt vi's on the data manipulation palette.
    For the AD7904 I believe the MSB is the first one in the stream, so you may need to re-order the data to match correctly and since the AD7904 is only actually expecting 12 bits of data, but requires 16 clocks, then you need to make sure you've pushed the data to the correct end of the two 8 bit numbers.
    The timing performing this however might not match to the AD7904 if it introduces a SCLK setup time delay in between each byte (hence an array of them shouldn't generate the delay).
    Have a look at the shipping Atmel AT25080A Read.vi (and the matching write one) under the example finder - search for SPI.
    You should find that there's a 16 bit number split into 2 8 bits for transmission before going into a build array with the 0x3 read command on the front.
    Hope that helps
    Thanks
    Sacha Emery
    National Instruments (UK)
    // it takes almost no time to rate an answer

  • Can I use a USB superdrive DVD reader/writer with a mac pro?

    The internal CD/DVD read/writer in my macpro (2 x 2.66 ghz dual-core xeon) broke, so I purchased an external USB superdrive, thinking I could use it as an external drive. It does nothing when plugged into the mac pro, I cant even insert a disk. It seems to not even have power.    
    Anyway I now see the device (superdrive) is intended for a macbook air or mac mini.
    Am I toast? Is there no way I can get this thing to work with the mac pro?
    I dont think I can return it, I've already discarded all the packaging.
    Thanks for any advice.

    I agree it would not take a lot of time, 2 minutes perhaps for the world record holder, for me more like 10 perhaps, not including the time involved in purchasing the drive, figuring out how to recycle the old broken one that comes out, etc.
    However the key point is that if I can get this drive to work, the cost will be $0, as I've already paid for it. So I would be most interested in doing that, if possible. If it's not possible, then I'll have no choice to pay $30 or however much, for a new one.

  • NI USB-8451 SPI clock release

    Is it possible to release the SPI clock signal so it reamins high immediately after sending data on the SDO line? Currently, SCLK is held low for a significant period of time after transmission of the final data bit before it is released to a logic high state. Is there a way to configure this? Is there also a way to configure DIO signals independent of the SPI using scripting?

    Hi John,
    I believe you are referring to the clock polarity and phase.
    Where Can I Find More Information About the SPI Clock in a USB-8451?
    http://digital.ni.com/public.nsf/allkb/4FB0A184E545AC1586257609007537EF?OpenDocument
    The information is found here in the NI-845x Hardware and Software Manual:
    http://www.ni.com/pdf/manuals/371746e.pdf#page=26
    Additionally, beyond using SPI scripting, we can use the basic SPI and basic DIO examples installed with the 845x driver in Help > Find Examples.
    Joey S.
    Software Product Manager
    National Instruments

  • Usb 8451 SPI slave mode

    Bonjour,
    peux t on configurer le module USB 8451 en mode Slave.
    comment utiliser les sorties MISO et MOSI
    je cherche a recuper les informations d'un microcontroleur en mode maitre qui envoie des donnees 8 bits ( il fournit la clock , le cs et les donnees )
    merci pour votre aide
    salutation

    Bonjour Jerome,
    Malheureusement, cette carte ne peut pas être utilisé en mode esclave.
    Concernant l'utilisation des signaux MISO et MOSI je pense que vous possédez déjà la doc de la carte. Sinon la voici :
    http://www.ni.com/pdf/manuals/371709b.pdf
    Par ailleurs, je vous invite à consulter cette article qui pourrait peut-être vous aider :
    http://zone.ni.com/devzone/cda/tut/p/id/8359
    N'hésitez pas à nous répondre si vous avez encore des questions en précisant quel logiciel vous utilisez (LabVIEW...) et avec quel microcontroleur vous souhaitez dialoguer.
    Cordialement
    Jean-Philippe
    Jean-Philippe C.
    National Instruments France

  • Looking for USB-8451 SPI example

    Does anyone have a typical SPI example VI for the USB-8451 Interface. I want to program a VI for a SPI device, but I don't know how. This example should include DIO Line programming as well, if possible.

    Hello thmsfrst,
    http://zone.ni.com/devzone/conceptd.nsf/webmain/B380E99DAAD898B38625710F007003C5?OpenDocument
    This link shows an example how to the USB8451 and the SPI  Interace to evaluate a TI  ADC
    The example download does not work so i have attached an example for LV8.0 and one for 7.1.
    If you have further questions don't hasitate to ask
    Stefan
    Attachments:
    example.7z ‏92 KB

  • I2C USB 8451 ADS1100 read result incorrect

    Hi,
    I have connected ADS1100 (http://www.ti.com/lit/ds/symlink/ads1100.pdf) to measure the temperature sensor output voltage of LMP91000 (http://www.ti.com/lit/ds/symlink/lmp91000.pdf). In LMP91000, I have write 0x7 to switch the MODECN to TIA ON mode in order to measure the 'Temperature Sensor' appeared on pin 'VOUT' only.
    1. Attached 'write to MODECN of LMP91000.vi' seems correct.
    Then, I change the slave address to 0x49 of ADS1100 to measure the output code for the temperature voltage. There is one register named 'configuration register' which has a default data 0X8C. There is a two-byte 'output register' which is the output code of ADS1100.
    2.Attached 'ADS1100 Read.vi' seems correct, but the read out data is incorrect, I think
    The 1st byte on SDA line is the address and R/~W bit which is correct;
    The 2nd byte on SDA line is the output upper byte. Here comes the problem——
    there should be 9 clocks appeared on SCL line during the 2nd byte.But, I have 8 clocks during this byte. I cann 't find the ACK signal.
    The 3rd byte on SDA line is the output lower byte. Here is another problem——
    there should be an ACK (0) on the 9th clock, on the contrary, the ACK is 1...
    The 4th byte returned the configuration register data, which should be 0x8C, but I cann't explain the wrong data appeared on the SDA line...
    I have to set up the values every time I run the vi.
    LMP91000 address: 0x48 MODECN register address: 0x12 MODECN register data :0x7
    ADS1100 address:0x49 Numer of bytes to read:3
    I/O voltage level:3.3V
    Pull up resistor :10 K
    I have searched on this forum to see if someone else have already solved this problem, but I did not get it.
    Any suggestions or answers to these quesitions are greatly appreciated. Thanks a lot!
    Sincerely,
    Ivy
    Attachments:
    block diagram.jpg ‏24 KB
    write modecn.vi ‏16 KB
    write to MODECN register.JPG ‏66 KB

    HI, GPIB Guru,
    At first, thank you very much for your detailed explainations.
    1.
     Interpreting the two scope captures, I see:
    write to MODECN register.JPG
    100100000 = x48 Read Ack
    000100100 = x12 Ack
    000001110 = x7 Ack
    ADS1100 Read waveforms.JPG
    100100110 = x49 Write Ack
    111110100 = xFA Ack
    100110110 = x9B Ack
    100011001 = x8C NAK
    Yes, I have realized that from the second output byte, there seems one clock delay for each byte, which can explain your interpretation above. But according to the ADS1100's datasheet, when the last byte (the configuration register which is 0x8C) is read out, the SDA line should pulled down to 0 to gives an ACK signal, not a high NACK signal.
    I have also attached the 'reading diagram from ADS1100'.
    2.
    It appears that your slave may be doing a clock stretch before the ACK bit can be set.
    I found in datsheets of both ADS1100 and LMP91000 that they both operates in Standard mode (100Khz). Actually, I have slowed down the clock rate and didn't find any changes on the read waveform. If I didn't follow your idea, please let me know. Thanks again for your kind reply.
    Sincerely
    Ivy
    Attachments:
    timing diagram for reading from the ADS1100.JPG ‏76 KB

  • USB SD Card Reader

    I have just purchased a USB SD card reader/writer to transfer pictures etc. from my desktop to my Palm Treo. When I plug the card and reader into the USB port, both the reader and the card mount, and I can view pictures and other files from my Palm; but I can't copy files to the card. Looking at the info of the disk reveals that I have read-only permission, and I can't for the life of me figure out how to change that. Has anyone had any luck changing SD card permissions on a Macbook? The rest of the internet is coming up short on this question...

    Same problem here. After chatting Mr Friendly, the on-line Apple Man I have the same problem.
    I use many card formats, Sonys Stick mostly, and this is my first time with these 'SD' cards.
    I have NO user permissions at all for a card I bought for my new DC camcorder.
    It was formatted first as I always do, the icon is 'Untitled' on the Desktop. 'Get Info' shows no user privileges... no re-naming... nothing at all.
    I can't even drag/drop files to the trash. I have to open the camcorder and manually format or delete every time.
    Where IS that clever Mac God when you need one?

  • USB 8451-how to set a chip select value

    I need some help on USB-8451 SPI programming using LabVIEW. On the USB-8451 device, there are 8 physical chip select (CS) lines. I will need to program or use all of these CS lines to select one of the 13 SPI slave chips on the circuit board. I know I will have to use the SPI Configuration Property Node to program CS state. What value should I use to set the CS property if need the following CS line states to select one of our chips?
    CS0 = 1; CS1 = 0; CS2 = 0; CS3 = 1; CS4 = 1; CS5 = 0; CS6 = 1; CS7 = 0
    Thanks, Min.

    FYI: VI referenced is attached.
    Chris R.
    Applications Engineer
    National Instruments
    Attachments:
    845x CS Lines Set_modified.vi ‏28 KB

  • Need help - I2C write/read with TAOS TCS3414 light sensor using USB-8451

    Hello, I'm new to labview and need help setting up a vi that will allow me to communicate with a digital light sensor (TAOS TCS3414) using a USB-8451. I need to use the sensor to measure light from a light source that I designed and built as part of a project im working on. I've tried looking at several labview I2C exampled but find them to be very confusing. I've used an arduino to interface with the sensor successfully but need to use labview and dont understand how to write the program. The actions are simple; I need initialize the sensor with a simple command and then request data from 8 data registers and then read that data. The data will then be used in further calculations. The portion i need help with is writing and reading from the sensor. I've attached the datasheet for the sensor as a guide. I can also provide the arduino code that i use to read data from the sensor if that would help. 
    Pleae keep in mind that i am completely new to labVIEW. I really do want to learn from this but need quick results so the more help the better. It would greately appreciate any help or explaination. 
    Attachments:
    TCS3414_Datasheet_EN_v1.pdf ‏1806 KB

    Hi Aaron,
    Here you go, this is made with a USB-8452.
    When you run the code tick the power en dac enable box on.
    Maybe you can help me with my problem, I want to use a fiber to sense light from a led.
    Do you use any fiber hardware with the TCS3414?
    gr,
    Attachments:
    TCS3414.vi ‏63 KB

  • What shall I put in the "device reference in" in the Read.vi?? for my USB-8451, where I found the name to be USB0::0x3923::0x7166::01349C20::RAW??

    as title
    what shall I put in the "device reference in" in the Read.vi?? for my USB-8451, where I found the name to be USB0::0x3923::0x7166::01349C20::RAW??
    i put the whole name in and it keep telling me
    Error -301706 occurred at NI-845x I2C Read.vi
    NI-845x:  The device reference is invalid. Verify that the supplied device reference contains a valid device name.
    Thanks!

    Chihway,
    I apologize for misreading your post the first time around.  Dennis is only half correct in this case.  The USB-8451 is supposed to show up as a USB-RAW device in MAX, but you do not have to run the driver wizard to create an interface to it.  In Measurement and Automation Explorer, select the USB-RAW device under USB Devices and create a VISA alias (I always use 8451) by typing it in the "VISA Alias on My System" box.  You should then be able to use that alias for all communication.  I hope this post helps a little more than the last one!
    Sincerely,
    Chris G in AE

  • ThinkPad External DVD Reader / Writer USB 2.0??

    Hi, one of the largest online selling and buying website in New Zealand, trademe, has listed via a buyer a ThinkPad External DVD Reader / Writer USB 2.0. One of my friend bought it and found that it is shown on the computer hard drve as a Philips DVD RAM SDVD 8821 HUSB. The buyer claimed that it is a genuine product bought from IBM shop. I am asking if there is a possibility for that to happen? If it is a fake product of IBM, is my friend liable to buying fake stuff. I think she was duped to think it is a genuine product. I asked this question via the IBM Australia. The respondent told me the model number was "Part Number - 43N3264". I had a search on google and the part number of the leveno external drive is not similar to the one I bought from the online shop. Mine one has got the logo of "thinkpad" on the bottom right hand corner. Whereas the external drive with the part number 43N3264 had the logo of leveno on the bottom left hand side. That's why I need to ask you in this inquiry. Intuitively, I don't think "thinkpad" has manufactured external drive. It has only been used as laptop models. Thanks for your attention.

    there are several fake ones on the market, some are well made while others are not.
    AFAIK the genuine one don't have a thinkpad logo, but rather a Lenovo logo.
    Regards,
    Jin Li
    May this year, be the year of 'DO'!
    I am a volunteer, and not a paid staff of Lenovo or Microsoft

Maybe you are looking for

  • Quick Selection Tool problem

    My Quick Selection Tool seems to be extremely quick to select the entire image.  Even with a very small size and very slow movement, I am having a hard time selecting what I intend to.  I don't remember having this problem a week ago. Is there a sens

  • New nvidia driver 56.6

    what about this driver, it seems for me, it's loosing some tabs, i can't find, opengl tab settings, and directx, or memory allocation for directx.....m i missing something?

  • Upgrade CS CS2 CS5 Ok?

    Im installing a new system with Snow Leopard. Im have a couple of older CS upgrades that I would like to upgrade to CS5. From that I have read in this forum, installing CS2 may not work on Snow Leopard. The advice I read was to type the CS2 serial nu

  • Page error message

    I have purchased and downloaded several books without a problem...that is until today. Of the books I downloaded only one does not display propery. When I go to open the book I get a triangle with an explanation mark in it and the words Page Error. W

  • CCMS agents not collecting relevant data f

    Hi, I am working on product where all components were integrated into one product(like EP, XI, TREX, SCM,livecache,CRM,ECC). Here the database is integrated to Livecache and normal DB(single DB). The CCMS agents were configured properly where some ti