Hello to every one,
I must acquire two voltage level on ANC2 and other on ANC3, unfortunatelly what it measures on ANC2 is reported onANC3 while in reality they are two different tension readings !!
Lock the debug (restectively ADC2 and ADC3)!!
There's some one who can help me please?
AD Converter on ANC2, ANC3 not read well 16(L)F18346 SOLVED
AD Converter on ANC2, ANC3 not read well 16(L)F18346 SOLVED
- Attachments
-
- Debug-ANC2-ANC3.jpg (361.3 KiB) Viewed 671 times
-
- ADC_ConverterConfig_1.jpg (224.31 KiB) Viewed 673 times
-
- ADCTest-DebugUART16F18346-V1.0-WORK.zip
- WARNING !!!!! CODE NOT WORK
- (144.45 KiB) Downloaded 28 times
Last edited by leo73 on 25 Oct 2022 18:45, edited 2 times in total.
Re: AD Converter on ANC2, ANC3 not read well 16(L)F18346
Hello,
I SOLVED
In attachement worked project.
I SOLVED
If you are using two or more AD channel, every time you changhe channel to acquire you must select channel like this:
Code: Select all
// selec chanel ANC3
ADCON0.CHS5=0;ADCON0.CHS4=1;ADCON0.CHS3=0;ADCON0.CHS2=0;ADCON0.CHS1=1;
ADCON0.CHS0=1; //010011
Delay_ms(50); // wait stabilistation
amplitude = Lecture_ADC2(0x13);
// selec chanel ANC2
ADCON0.CHS5=0;ADCON0.CHS4=1;ADCON0.CHS3=0;ADCON0.CHS2=0;ADCON0.CHS1=1;
ADCON0.CHS0=0; //010010
Delay_ms(50); // wait stabilistation
amplitude = Lecture_ADC2(0x12); //ANC2=0X12 // ad read on ch:14 (ANC3)
- Attachments
-
- ADCTest-DebugUART16F18346-V2.0-WORK.zip
- CODE WORK 100%
- (50.53 KiB) Downloaded 23 times