How Do I Set the Chip Select of an NI-8451 SPI Chip to Active High?

Updated Oct 1, 2018

Reported In

Hardware

  • USB-8451

Driver

  • NI-845x

Issue Details

I have a chip I am trying to communicate with using the NI-8451's SPI bus.  The NI-8451 uses an active low chip select by default, but my chip uses an active high chip select (the chip select line has to be 3.3V to allow communication).  How do I change this behavior on the NI-8451?

Solution

In order to change the behavior of the CS line on the NI-845x, you will need to use the script API. The script API provides manual control of the CS line, so it can be set high or low before communication on the bus and returned to an idle state after.

Additional Information

Remember to include an NI-845x SPI Script CS Low.vi in the beginning of your program to ensure that the active high functionality is implemented.  This is due to the chip select initially being high in value, which is remedied by setting the chip select low after your initial VIs: NI-845x SPI Create Script Reference.vi, NI-845x SPI Script Clock Polarity Phas.vi, NI-845x SPI Script Clock Rate.vi, and NI-845x SPI Script Enable SPI.vi.  This should be done for each chip select you plan to use to regulate communication to devices as described in Setting Multiple Chip Selects on the NI USB-845x

The script API VIs are located in the NI-845x » SPI Advanced palette. 

Please download the attached file for a complete example.