Main Site Documentation

SPI implementation issue


#1

The situation I have currently is that I am trying to send data through a SPI bus to a slave device and I am noticing that “sometimes” not all the data I am expecting is present on the analyzer.

Analyzer <----- ARINC bus -------- Holt IC 3585 <------ SPI bus -----> USbizi144chipset

So I am wondering if my spi configuration is setup wrong? Do I need to monitor something such as the SPI busy pin or some other caveat for high volumes of SPI writes.

Thanks for any help in advance.

Here is the information I have:

Datasheet for the HoltIC 3585 http://www.holtic.com/products/2985-hi-3585-hi-3586.aspx
I am using the USBizi144 chipset on a custom layout.

Code Snippets:

            

SPI.Configuration SPIConfiguration = new SPI.Configuration((Cpu.Pin)FEZ_Pin.Digital.IO9, // Chip Select Pin IO26/P0.16
                                                                            false, // IC is accessed when chip select is low
                                                                                0, // Setup Time
                                                                                0, // Hold Time
                                                                            false, // Idle : false = Idle Low : true = Idle High
                                                                             true, // Clock Edge : true = rising edge / false = falling edge
                                                                             4000, // 4 MHZ clock speed
                                                             SPI.SPI_module.SPI1); // Use 2nd SPI bus


        byte[] ARINC_429_TX_FIFO_DATA = new byte[5];
        // The writeTxFIFO will load a ARINC 429 word into the Tx FIFO
        // and transmit the ARINC message instantly
        // if the Control Register bit 13 is set to 1.
        
        // If the Control Register bit 13 is set to 0, ARINC messages 
        // will be loaded into the Tx FIFO and wait for the OP Code 0x12 (writeTxImmediate) before broadcasting..
        public void writeTxFIFO(byte[] arincWord)
        {

              

                ARINC_429_TX_FIFO_DATA[0] = OP_CODES.WRITE_TO_TX_FIFO;

                Array.Copy(arincWord, 0, ARINC_429_TX_FIFO_DATA, 1, 4);



                spi_device.Write(ARINC_429_TX_FIFO_DATA);

               
            

        }