2022-03-12 05:04 AM
for(int i=0;i<3000;i++)
{
//__HAL_TIM_SET_COUNTER(&htim4,0);
while(!(GPIOI->IDR &(1<<5))); //monitoring RVS Pin
GPIOI->ODR &= ~(1<<0); // CS pin Low
HAL_SPI_Receive(&hspi2, data_rcv ,2,1); // reading 2 bytes at a time
GPIOI->ODR |= 1<<0; //CS pin high
temp[temp_cnt]=((data_rcv[0]<<8)|data_rcv[1])>>4;
temp_cnt=temp_cnt+1;
// counterCount=TIM4->CNT;
}
2022-03-12 06:10 AM
There was a similar question here recently: https://community.st.com/s/question/0D53W00001NVgChSAL/interface-with-external-adc-via-spi-at-1mss
hth
KnarfB