ADC value geting always high

General discussion on mikroProg™ programmer and debugger and mikroProg Suite software as well.
Post Reply
Author
Message
mmm
Posts: 38
Joined: 28 Apr 2019 18:25

ADC value geting always high

#1 Post by mmm » 28 Jun 2019 14:08

Hi,
we are using PIC16F1526 MCU and reading the analog pin of AN19, it's always reading the value 1023 even if we don't give any voltage from that pin. what might be an issue?

regards,
mmm

User avatar
jovana.medakovic
mikroElektronika team
Posts: 986
Joined: 18 Dec 2018 10:36

Re: ADC value geting always high

#2 Post by jovana.medakovic » 01 Jul 2019 14:50

Hello,

Could you send your project for review?
Did you try to do what my colleague Stefan told you on this forum post:
viewtopic.php?f=218&t=74852&p=299509#p299509

Kind regards,
Jovana

mmm
Posts: 38
Joined: 28 Apr 2019 18:25

Re: ADC value geting always high

#3 Post by mmm » 02 Jul 2019 05:02

yes i tried but its not working for me.

User avatar
jovana.medakovic
mikroElektronika team
Posts: 986
Joined: 18 Dec 2018 10:36

Re: ADC value geting always high

#4 Post by jovana.medakovic » 02 Jul 2019 09:14

Hi,

Could you zip and send me a minimal project which demonstrates your problem?

Kind regards,
Jovana

mmm
Posts: 38
Joined: 28 Apr 2019 18:25

Re: ADC value geting always high

#5 Post by mmm » 02 Jul 2019 10:09

in my bootloader code i set the application reset vector address is 0x500h so in mikro c we can se the address using #pragma and the delay function not working for so i wrote own function to generate delay but i didnt get the output with a delay.

#pragma orgall 0x500
#define iend 25 //delay loop is iend times jend instruction cycles
#define jend 1000

void delay(void) // 100 msec
{
int i,j;
for (i=0; i<iend; i++)
for (j=0;j<jend; j++);
}
int main()
{ OSCCON = 0b01111011; //OSCILLATOR CONFIG , 16MHz
TRISE = 0xFF;
while(1)
{
LATE = 0x01;
delay();
LATE = 0x00;
delay();

}

}


regards
mmm

User avatar
jovana.medakovic
mikroElektronika team
Posts: 986
Joined: 18 Dec 2018 10:36

Re: ADC value geting always high

#6 Post by jovana.medakovic » 02 Jul 2019 16:48

Hello,

I believe that my colleague Stefan has already answered you on this forum post:
viewtopic.php?f=88&t=74844&p=299636#p299636

Kind regards,
Jovana

Post Reply

Return to “mikroProg™ programmer and debugger”