ADC_Get_Sample not working anymore
Posted: 11 Jul 2018 09:38
Hello there, I had a project I did using the ATmega 8L about two years ago.
I had to use:
to set up the ADC for a custom value, then the
Was used to read the adc values with out disrupting ADMUX and ADCSRA settings.
It looks like now the ADC_Get_Sample is used in XMEGA series now.
It no longer works in my project, instead it shows:
and Read_ADC(#) as how to read the ADC.
Well the reason I had to go the original way, was to avoid the use of ADC_Init() as it always messes up my custom ADC settings.
Now that ADC_GET_Sample no longer works for me and ADC_Init() can't be used for it's non suitability, what is left now to use instead of adc_get_sample?
I want to keep the adc setup as it was before and still read it.
Any ideas?
Thanks for any help you can provide,
Robert
I had to use:
Code: Select all
'ADMUX = 0X00 '- Select external reference (Aref), left justify the result and set chanel 0 as default
'ADCSRA = 0xCE '- ADC Enable, Start conversion, no auto trigger, Clear interupt flag, enable interupt, pre scaler set to 64 = 125,000 Khz
Code: Select all
ADC_Get_Sample(0) '- Acquire analog value from channel 0 (Current Sensor) Max = 0x03FF
It looks like now the ADC_Get_Sample is used in XMEGA series now.
It no longer works in my project, instead it shows:
Code: Select all
ADC_Init() ' Initialize ADC module with default settings
Well the reason I had to go the original way, was to avoid the use of ADC_Init() as it always messes up my custom ADC settings.
Now that ADC_GET_Sample no longer works for me and ADC_Init() can't be used for it's non suitability, what is left now to use instead of adc_get_sample?
I want to keep the adc setup as it was before and still read it.
Any ideas?
Thanks for any help you can provide,
Robert