I have a design using the uc3b0256 as SPI master, and 4 different slave chips connected to the SPI bus, using the 4 different chip select lines. I am using
PA25 as MISO
PA14 as MOSI
PA15 as SCK
PA16 as NPCS0
PA17 as NPCS1
PB05 as NPCS2
PB04 as NPCS3
I have an nrf905 on NPCS0, a SST25VF016B serial flash on NPCS1, a MCP23S17 on NPCS2, and a sub micro controller ATMEGA168PA as slave on NPCS3
Now I am battling to figure out how to setup the framework (using 3.4.0) to switch between the chips using either spi_selectChip/spi_unselectChip or spi_select_device/spi_deselect_device
I cant seem to find an example that talks to more than one slave chip. I only seem to be able to get the chip on NPCS0 to work, and the others dont seem to work. I checked the NPCS1/2/3 lines with scope and my code doesnt seem to be able to toggle them. I am uncertain what I need to do.
Can anyone perhaps provide an example to talk to more than one chip in SPI_MODE_0 with 8 bit data length. I have been using a clock speed of 8mhz for the slaves, and all 3 of the chips should work with this. My main clock on the uc3b0256 is 18.432mhz
Can anyone help ?