AnsweredAssumed Answered

Unable to acheive 3200 samples per scond could not come out of interrupt

Question asked by srm@tech on Jul 3, 2017
Latest reply on Mar 20, 2018 by jwang


I would like to achieve 3200 samples using ADxl345 interfacing Microcontroller with frequency 32 MHz using SPI communication running at 5 MHz (Highest Frequency). Normally i am using USART with 115200 baud to communicate with device so that whenever I send command to ON and OFF Adxl sensor and its data rate setting are written through my protocol. Until 1600 Hz it works perfectly all right no issue with communication (serial com provides response from device). As per the System Frequency is 32000000 i.e HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000); which means time between interrupt generation is 1/32000 = 0.03125 msec. Every interrupt generated @ 0.03125 Msec. Now coming to ADXL 345 sensor 3200 samples per second for 1 sample to achieve is 0.3125 msec every interrupt executes. My question is that as per the system frequency it is good enough to achieve 3200 samples per second but I could not get any response after initialization the command to start adxl sensor with 3200 samples. It never comes out of the loop to execute the statement so no response is produced in turn. I would like to attach code snippets. Kindly help me if i would like to acheive 3200 samples per second. Can i acheive samples with controller frequency of 32 Mhz. If so could please provide me the indormation. I here by attach the code snippets.