Analog input not working on PIC32MZ2048ecg100

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

stefan.erni
Valued Contributor
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

Post by stefan.erni »

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.

AD1.PNG
(40.16 KiB) Downloaded 469 times
Clicker2_Pic32efh100-display_AD_Converter1.fcfx
(28.8 KiB) Downloaded 200 times

stefan.erni
Valued Contributor
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

Post by stefan.erni »

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
Simulation.PNG
Simulation.PNG (6.68 KiB) Viewed 1857 times

User avatar
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

Post by Benj »

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.

Code: Select all

ANSELBbits.ANSB0 = 1;
ANSELBbits.ANSB1 = 1;
ANSELBbits.ANSB2 = 1;
If this works then I should be able to sort the component so it generates these calls for you.

stefan.erni
Valued Contributor
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

Post by stefan.erni »

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

Post Reply