|
![]() ADC/DAC/VREF/Comparators
![]() F350 24-bit ADC
|
| next newest topic | next oldest topic |
| Author | Topic: F350 24-bit ADC |
|
newish New Member |
I am using the F350 24-bit ADC. Maybe I've been looking in the wrong place or may have just missed something in the data sheets... Can anyone tell me what the maximum differential input voltage I can read in between, say, AIN0+ and AIN0-. I actually need to read in up to +/-1.5 VDC differential voltage but when I run the demo program with the registers set up for differential inputs, the readings are incorrect when I put a 1.5VDC battery between AIN0+ and AIN0-. If the F350 can read up to +-1.5VDC in differential mode, what are the changes I need to make in the relevant registers. Thanks Al IP: Logged |
|
picperson Member |
Unipole 0 to +Vref Bipolar -Vref to + Vref. Using the internal reference Vref = 2.35 to 2.50, 2.45V nominal. If your using the F350 development kit and using the internal VREF, jumper 12, pins 9 and 10 should have a link fitted to ground the -ve REF pin. Put a meter across the +ve REF and AGND to see if the 2.45 volts is there. If not, check -Vref is connected to AGND. What results are you getting in the ADC conversion and ADC0STA registers when you do a single ADC reading. What do you believe you should be seeing as the results. Is any calibration cycles included in the code. Post the code, we can then see what setup you are using. Then give us some time to see if we can help you out. If you find what is wrong, please post the reason so others can learn from your experience. Regards,
IP: Logged |
|
al9090 New Member |
Thanks for the reply Mike... I've used the external reference and am getting 2.5VDC across VREF+ and AGND in the terminal strip. I've also used the demo program "F35x_ADC0_Buffered.c" that came with the evaluation board. I've then used a bench power supply to connect up to AIN0.0 and AIN0.1. Register ADC0MUX = 0x01 and so I connected the positive bench supply to AIN0.0 and the negative to AIN0.1. The readings I get when I run this program are ok up until around 1.25V and any further increase in the input voltage results in the readings becoming negative and decreasing in value. It as if the some register has over-flowed. Relevant extracts of the example code are shown below. Essentially, its the initialization of the ADC, full internal calibration, and collection of the data, in this case 128 samples because the demo program calculated the average, standard deviation, etc..Could the problem be in the conversion to uV, "Note2:" below?
//Full internal calibration //concatenate ADC0 data bytes to for (i = 0; i < 128; i++) // Caculate measured voltage in uV: Calculated_uV = // Output result: void ADC0_Init (void) REF0CN &= ~0x01; // program decimation rate for desired OWR ADC0_decimation--; IP: Logged |
|
al9090 New Member |
Thanks for the reply Mike... I've used the external reference and am getting 2.5VDC across VREF+ and AGND in the terminal strip. I've also used the demo program "F35x_ADC0_Buffered.c" that came with the evaluation board. I've then used a bench power supply to connect up to AIN0.0 and AIN0.1. Register ADC0MUX = 0x01 and so I connected the positive bench supply to AIN0.0 and the negative to AIN0.1. The readings I get when I run this program are ok up until around 1.25V and any further increase in the input voltage results in the readings becoming negative and decreasing in value. It as if the some register has over-flowed. Relevant extracts of the example code are shown below. Essentially, its the initialization of the ADC, full internal calibration, and collection of the data, in this case 128 samples because the demo program calculated the average, standard deviation, etc..Could the problem be in the conversion to uV, "Note2:" below?
//Full internal calibration //concatenate ADC0 data bytes to for (i = 0; i < 128; i++) // Caculate measured voltage in uV: Calculated_uV = // Output result: void ADC0_Init (void) REF0CN &= ~0x01; // program decimation rate for desired OWR ADC0_decimation--; IP: Logged |
|
vanmierlo Member |
Calculated_uV = ((((((ADC_OutputVal*2*VREF)/16)*10)/1024)*1000)/1024); When ADC_OutputVal >= 0x00800000 the multiplication with 2*VREF overflows(assuming VREF=250). Furthermore by assigning ADC_OutputVal with (ADC0H<<16) | (ADC0M<<8) | ADC0L you loose the sign. I advise to assign it with (ADC0H<<24) | (ADC0M<<16) | (ADC0L<<8) and divide by 256 afterwards. IP: Logged |
|
newish New Member |
much appreciated for the solution... Al IP: Logged |
All times are CT (US) | next newest topic | next oldest topic |
![]() |
|
Have you seen our MCU Knowledge Base?