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
ADC value geting always high
- jovana.medakovic
- mikroElektronika team
- Posts: 986
- Joined: 18 Dec 2018 10:36
Re: ADC value geting always high
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
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
Re: ADC value geting always high
yes i tried but its not working for me.
- jovana.medakovic
- mikroElektronika team
- Posts: 986
- Joined: 18 Dec 2018 10:36
Re: ADC value geting always high
Hi,
Could you zip and send me a minimal project which demonstrates your problem?
Kind regards,
Jovana
Could you zip and send me a minimal project which demonstrates your problem?
Kind regards,
Jovana
Re: ADC value geting always high
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
#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
- jovana.medakovic
- mikroElektronika team
- Posts: 986
- Joined: 18 Dec 2018 10:36
Re: ADC value geting always high
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
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