Other Parts Discussed in Thread: REF6050, REF02
Hi,
I try to use an ADC ADS8332 with SPI communication.
It seems to be work great.
I am able to configure the CFR register (the config is 0b011111111111);.
I tried also to read data value with manual trigger. But I have a problem with this part. I read well a 16 bits data but I have no noise on the data. And there is step on the data like the curve I join
I tried to insert some delay to slow down the acquisition process. But i have always the same results.
I have also the problem in automatic trigger.
Moreover sometimes, the EOC doesn't go to low when I put CONVST at low. So, I have to put back CONVST at high and low.
This is the code which I use to read channel 1 for example
uint16_t adc_read_channel_1() { long t = millis; while(millis - t <5); CONVST_Clear(); while(EOC_INT_CDI_Get()!=0) { CONVST_Set(); CONVST_Clear(); } while(EOC_INT_CDI_Get()==0); CONVST_Set(); uint8_t send[4] = {READ_DATA,0,}; uint8_t receive[3] = {0}; CS_ADC_Clear(); SPI1_WriteRead(send, 2, receive, 3); CS_ADC_Set(); if(receive[2] ==32) SYS_CONSOLE_PRINT("%i \n\r",((uint16_t)(receive[0]<<8) + receive[1])); return ((uint16_t)(receive[0]<<8) + receive[1]); }
And the schematic
Thank you for your help and sorry for my bad english!
Best regards,
Anthony