dbp
Newbie level 4
Hello team,
I have to interface the ADS7046 12-Bit, 3-MSPS, Single-Ended Input, Small-Size, Low-Power SAR ADC with STM32H745iik6 controller. SPI compatible ADC 12 bit resolution and MSPS.
So as my code ADC read properly but sampling rate does not get as my desired.
My challenges is that
1) how to get 3msps means CS falling edge to falling edge (Tcycle=333nS) required. as datasheet mention timing diagram below.
But I got approx. 5uS. SPI read with polling method and CS simple gpio. below attach some snap of scope and code.... Red= CS, Blue= Sclk 16pulse
in above code i read 500 sample and store in buffer then print using usb.
So i applied input square awve waveform but as my observation upto 40Mhz square read good then aliasing occure....
i just want to fast spi read...
2) how to minimize sclk pulse regenrate time. means spi generate 16 pulse then it take 5uS delay then again generate. there is no issue in gpio. just want to minimize off time of sclk . how can i minimize...
without CS also taking same time for sclk.
i set my controller clock frequency as below.
I have to interface the ADS7046 12-Bit, 3-MSPS, Single-Ended Input, Small-Size, Low-Power SAR ADC with STM32H745iik6 controller. SPI compatible ADC 12 bit resolution and MSPS.
So as my code ADC read properly but sampling rate does not get as my desired.
My challenges is that
1) how to get 3msps means CS falling edge to falling edge (Tcycle=333nS) required. as datasheet mention timing diagram below.
But I got approx. 5uS. SPI read with polling method and CS simple gpio. below attach some snap of scope and code.... Red= CS, Blue= Sclk 16pulse
C:
for (int m = 0; m < 500; m++) {
HAL_GPIO_WritePin(GPIOG, SPI3_CS3_Pin,GPIO_PIN_RESET); // SPI3 TL1_VMEAS
// HAL_SPI_Receive_IT(&hspi3, (uint8_t*)&ADC_Value3,1);
HAL_SPI_Receive(&hspi3, (uint8_t*)&ADC_Value3, 1, HAL_MAX_DELAY);
buff3[m] =ADC_Value3;
// OUTPUT_VOLTAGE3=((3.3/4095)*ADC_Value3/4);
HAL_GPIO_WritePin(GPIOG, SPI3_CS3_Pin,GPIO_PIN_SET); // SPI3 TL1_VMEAS
}
// Transmit USB packets after i reaches 500
for (int j = 0; j < 500; j++) {
sprintf(buffer3, "%d\n\r", buff3[j]);
CDC_Transmit_FS((uint8_t *)buffer3, strlen(buffer3));
// delay_us(10);
memset(buffer3,'\0',sizeof(buffer3));
}
m = 0;
memset(buff3,'\0',sizeof(buff3));
in above code i read 500 sample and store in buffer then print using usb.
So i applied input square awve waveform but as my observation upto 40Mhz square read good then aliasing occure....
i just want to fast spi read...
2) how to minimize sclk pulse regenrate time. means spi generate 16 pulse then it take 5uS delay then again generate. there is no issue in gpio. just want to minimize off time of sclk . how can i minimize...
without CS also taking same time for sclk.
i set my controller clock frequency as below.