We are using LM4FH5qd microcontroller from Tiva series,We are using SPI protocol to read the register values from ADIS16480 sensor.When we were reading single register we are getting proper value But when we read more than one register then the values in the read variables are getting swapped.Please see the code snippet below. Are we reading properly or is there anything we are missing?
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); InitConsole(); SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); GPIOPinConfigure(GPIO_PA2_SSI0CLK); GPIOPinConfigure(GPIO_PA3_SSI0FSS); GPIOPinConfigure(GPIO_PA4_SSI0RX); GPIOPinConfigure(GPIO_PA5_SSI0TX); GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_5 | GPIO_PIN_4 | GPIO_PIN_3 | GPIO_PIN_2); SSIConfigSetExpClk(SSI0_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_3, SSI_MODE_MASTER, 1000000, 16); variable= SysCtlClockGet(); SSIEnable(SSI0_BASE); SSIDataPut(SSI0_BASE,0x8000);// for accessing pageID 0 SSIDataPut(SSI0_BASE, 0x6A00);//reading from 6A register SSIDataGet(SSI0_BASE,&DataRx7[0]); data_roll=(int)DataRx7[0]; SSIDataPut(SSI0_BASE,0x8000);// for accessing pageID 0 SSIDataPut(SSI0_BASE, 0x6C00);//reading from 6C register SSIDataGet(SSI0_BASE,&DataRx8[0]); data_pitch=DataRx8[0]; //Note:the problem is data_roll is having the value of the register 6C and data_pitch is having the value of the register 6A.