Hi Ben
The simulation is working fine.
In the hardware its' showing for all the AN signals the value from AD0. If I change the paramter from AN01 Vref to 5Volt
it' shows the the value still from AN0, but in the range of 5 volt.
Analog input not working on PIC32MZ2048ecg100
Moderator: Benj
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: Analog input not working on PIC32MZ2048ecg100
Hi Ben
I changed the board. Now I'm using a PIC32MZ2048efh100
In the simulation all the 5 analog channel are working fine.
In the hardware is just the AN0 working. The bad thing is that the value from AN0 is showing on all the 5Channel in the display.
I suspect flowcode does not switch to the correct analog input, it's always remains on AN0
regard
Stefan
I changed the board. Now I'm using a PIC32MZ2048efh100
In the simulation all the 5 analog channel are working fine.
In the hardware is just the AN0 working. The bad thing is that the value from AN0 is showing on all the 5Channel in the display.
I suspect flowcode does not switch to the correct analog input, it's always remains on AN0
regard
Stefan
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Analog input not working on PIC32MZ2048ecg100
Hello Stefan,
This could mybe be an ANSEL register problem? Please can you try the following code in a C icon and see if it makes any difference. CHange the register name and bits to match the ADC inputs you're using in your program.
If this works then I should be able to sort the component so it generates these calls for you.
This could mybe be an ANSEL register problem? Please can you try the following code in a C icon and see if it makes any difference. CHange the register name and bits to match the ADC inputs you're using in your program.
Code: Select all
ANSELBbits.ANSB0 = 1;
ANSELBbits.ANSB1 = 1;
ANSELBbits.ANSB2 = 1;
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: Analog input not working on PIC32MZ2048ecg100
Hi Ben
Microchip stopped with the PIC32MZ ECG serie
Status: Not Recommended for new designs
The new one is the PIC32MZ EFx serie.
So changed the post to the new serie and new problem and solution
https://www.matrixtsl.com/mmforums/view ... 26#p102826
Microchip stopped with the PIC32MZ ECG serie
Status: Not Recommended for new designs
The new one is the PIC32MZ EFx serie.
So changed the post to the new serie and new problem and solution
https://www.matrixtsl.com/mmforums/view ... 26#p102826