2007-04-09 07:49 PM
2007-04-01 08:24 PM
Hi!
I am new with the STR71 and I am trying to use the ADC to sample four different analog inputs, so, I think I can use Round Robin mode. This is my code for init the ADC using the ST libraries: // Configure the 4 ADC analog input pin to High Impedance Analog Input GPIO_Config (GPIO1, ADC12_DA0, GPIO_HI_AIN_TRI); GPIO_Config (GPIO1, ADC12_DA1, GPIO_HI_AIN_TRI); GPIO_Config (GPIO1, ADC12_DA2, GPIO_HI_AIN_TRI); GPIO_Config (GPIO1, ADC12_DA3, GPIO_HI_AIN_TRI); // Initialize the ADC Registers ADC12_Init(); // Configure the ADC Prescaler ADC12_PrescalerConfig(500); // Select the round robin mode of conversion ADC12_ModeConfig (ADC12_ROUND); //Enable the converter ADC12_ConversionStart(); And in my program: if((ADC12_FlagStatus(ADC12_DA0)==SET)||(ADC12_FlagStatus(ADC12_DA1)==SET)||(ADC12_FlagStatus(ADC12_DA0)==SET)||(ADC12_FlagStatus(ADC12_DA0)==SET)) { //Disable the converter ADC12_ConversionStop(); if(ADC12_FlagStatus(ADC12_DA0)==SET) Line1=ADC12_ConversionValue(ADC12_CHANNEL0); if(ADC12_FlagStatus(ADC12_DA1)==SET) Line2=ADC12_ConversionValue(ADC12_CHANNEL1); if(ADC12_FlagStatus(ADC12_DA2)==SET) Line3=ADC12_ConversionValue(ADC12_CHANNEL2); if(ADC12_FlagStatus(ADC12_DA3)==SET) Line4=ADC12_ConversionValue(ADC12_CHANNEL3); //Clear all flags writing low ADC12->CSR &= (~(ADC12_DA0| ADC12_DA1| ADC12_DA2| ADC12_DA3)); //Enable the converter again ADC12_ConversionStart(); } I can emulate the program step by step (with the RLink from Raisonance in Flash memory) and everything is o.k. but when I use the run option, the ADC doesn’t work. I think that it’s not due to the ADC calibration and in my application it is not necessary. Can anybody help me?2007-04-04 09:12 PM
Hi,
Yes this behavior could not be due to the calibration.Are you using the STR711 Reva board from Raisonance? Could you send us the hole software project to reproduce the behavior and verify all the settings? Regards.2007-04-04 10:15 PM
Hi,
Yes this behavior could not be due to the calibration.Are you using the STR711 Reva board from Raisonance? Could you send us the hole software project to reproduce the behavior and verify all the settings? Regards.2007-04-09 07:49 PM
Thanks, it is working o.k.
I read in a application note that you have to wait, at least, 100ms between the instruction // Initialize the ADC Registers ADC12_Init(); and the instruction // Configure the ADC Prescaler ADC12_PrescalerConfig(500); Now, I’m waiting this time and everything is o.k. Regards