AnsweredAssumed Answered

PN7462 SPI Master issue

Question asked by Jean-Pierre Fortune on Mar 30, 2017
Latest reply on Apr 3, 2017 by Jean-Pierre Fortune

Hi,

 

I am trying to communicate with an external SPI slave from the PN7462 firmware.

I use the NXP librairie (PN7462AUPspPackageFull-v04_06_00) and check the resulting signals with an oscilloscope.

Whatever the data I send, the physical output is the same!

Here is the code:

#define PH_SPI_SLAVE_FLASH 0
#define PH_SPIM_MSB_FIRST 1
#define PH_SPIM_BAUD_RATE 0 // 1.0 MHz
#define PH_SPIM_NSSPULSE 0
#define PH_SPIM_NSSPOL 0
#define PH_SPIM_INIT_CRC 0
#define PH_SPIM_APPEND_CRC 0
#define PH_SPIM_CRC_INIT 0
#define PH_SPIM_CRC_OFFSET 0
phStatus_t spi_test()
{
     phStatus_t status;
     uint8_t buf[4] = { 0xFF, 0x00, 0xFF, 0x00 };

     phhalSPIM_Configure(PH_SPI_SLAVE_FLASH,
                                        PH_SPIM_MSB_FIRST,
                                        E_SPIM_MODE0,
                                        PH_SPIM_BAUD_RATE,
                                        PH_SPIM_NSSPULSE,
                                        PH_SPIM_NSSPOL);

     status = phhalSPIM_Transmit(PH_SPI_SLAVE_FLASH,
                                        PH_SPIM_INIT_CRC,
                                        PH_SPIM_APPEND_CRC,
                                        PH_SPIM_CRC_INIT,
                                        4,
                                        buf,
                                        PH_SPIM_CRC_OFFSET);
     return status;
}

I also join a screenshot of the resulting waveform (in red SCLK, in blue MOSI).

I have tried many other configurations (parameters, values, etc) without success.

I wonder what I am missing!

Any help would be appreciated!

Thanks in advance!

-- 

Jean-Pierre

Attachments

Outcomes