using stm32h747. I am reading ADC data using SPI on ADS8661 IC. the sampling rate we are able to read at is 14us using FOR loop(PFA). trying to reduce the sampling rate by DMA receive through tim12 trigger, not working, please guide me how to in cube mx
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-03-12 5: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;
}
Labels:
- Labels:
-
ADC
-
SPI
-
STM32H7 Series
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-03-12 6: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
