hello everyone ,
i have recently started working with dwm1000 modules and i have a question about how the SPI interface on the board works , this is an example of a transaction between the MCU ( tiva c in my case ) and the dwm1000 module
, i am trying to read the register address 0x00 which contains the 0xDECA0130 however since arm microcontrollers work with little endian i should be getting 0x30 0x01 0xCA 0xDE byte order on the bus.
also note that the SPICS line should be low through the whole transaction , i am using the tivaware api and here is how i initialize and send/read data
uint8_t DataToSend; uint32_t rxDataOne = 0x00; uint32_t rxDatatwo = 0x00; uint32_t rxDatathree = 0x00; // The SSI0 peripheral must be enabled for use. SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI2); //disable the module first to configure the SPI SSIDisable(SSI2_BASE); //enable clock of port b SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); //Set IO clock as SSI clock source //SSIClockSourceSet(SSI2_BASE, SSI_CLOCK_SYSTEM); // GPIOPinConfigure(GPIO_PB4_SSI2CLK); GPIOPinConfigure(GPIO_PB5_SSI2FSS); GPIOPinConfigure(GPIO_PB6_SSI2RX); GPIOPinConfigure(GPIO_PB7_SSI2TX); // while(!SysCtlPeripheralReady(SYSCTL_PERIPH_SSI2)); GPIOPinTypeSSI(GPIO_PORTB_BASE,GPIO_PIN_7|GPIO_PIN_6|GPIO_PIN_5|GPIO_PIN_4); SSIConfigSetExpClk(SSI2_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_0,SSI_MODE_MASTER, 2000000, 8); SSIEnable(SSI2_BASE); //configure data to send here DataToSend=0x00; //send data SSIDataPut(SSI2_BASE,DataToSend); while(SSIBusy(SSI2_BASE)); SSIDataGet(SSI2_BASE,&rxDataOne); SSIDataGet(SSI2_BASE,&rxDatatwo);
now i am suspecting this is due to i am using data get and data put to read and write to the bus and the tivaware api is de-aserting the SPICS between SSIDataPut and SSIDataGet functions , and it should be set to low through the whole transaction however since i am using 2 functions to read and write it turns it back to high after sending the first byte of data for example which would explain why i am only getting 1 byte of data and not anymore from the module .
if the above is correct i should modify my code to control the SSI CS pin manually through software am i correct ?
BR,
Essam.