DOUBTS : pic12f675 adc program

Started by vaishnavi236 February 27, 2004
hello,
THE ISR WAS ALREADY PRESENT IN THE TEMPLATE OF
PIC12F675...hence i did not delete it
without labelling main it completes the whole program expect for adc
loop....i don't how? i tried 'step into' so it executes 3/4th of the
program.
in the file register window i get all values as zeros but yes when
i go to view> watch i see values for all the registers .....but in
the o/p registers where i need to see values i.e adresh and adresl it
is always zero .
even i felt it goes to infinite loop mainly because i set go/done
bit again in the loop but i did not the understand jump to -1 as
somebody suggested can u please explain in detail how i can go about
doing it .thanks for ur suggestions once again its of great help
since this is my first project.
I DID NOT UNDERSTAND
**HOW WE CAN FEED AN ANALOG VALUE TO THE PIC THROUGH THIS SOFTWARE
PGM .....IS THERE ANY FACILITY TO GIVE INPUT VALUES..BUT
WITH THE H/W IT TAKES THE BATTERY CONDITIONS AS VALUES SAMPLES IT N
CONVERTS.....BUT HOW DO I DO IT IN THE PROGRAM..
** HOW DO WE CALCULATE THE RESOLUTION FOR ADC.. SO AS TO CHECK THE
VALUES.
** IN THE ANSEL REGISTER BITS3-0 R FOR ANALOG SELECT BITS
0= DIGITAL I/O ;PIN ASSIGNED TO PORT OR SPECIAL FUNCTION
1= ANALOG INPUT
HOW CAN ADC HAVE A DIGITAL INPUT B'COS THE I/P HAS TO B ANALOG
** IN THE PWM MODULE WHAT VALUE SHOULD I MOVE TO T1CON .....I AM
USING 1:1 PRESCALER AND INTERNAL CLOCK



I suggest you go to the microchip web site and find their numerous
appnotes for for ADC. You really should spend some time reading them
as all the answers to your questions are there.

Good luck with your assignment.

Phil

--- In , "vaishnavi236" <vaishnavi236@y...>
wrote:
> hello,
> THE ISR WAS ALREADY PRESENT IN THE TEMPLATE OF
> PIC12F675...hence i did not delete it
> without labelling main it completes the whole program expect for
adc
> loop....i don't how? i tried 'step into' so it executes 3/4th of
the
> program.
> in the file register window i get all values as zeros but yes
when
> i go to view> watch i see values for all the registers .....but in
> the o/p registers where i need to see values i.e adresh and adresl
it
> is always zero .
> even i felt it goes to infinite loop mainly because i set go/done
> bit again in the loop but i did not the understand jump to -1 as
> somebody suggested can u please explain in detail how i can go
about
> doing it .thanks for ur suggestions once again its of great help
> since this is my first project.
> I DID NOT UNDERSTAND
> **HOW WE CAN FEED AN ANALOG VALUE TO THE PIC THROUGH THIS SOFTWARE
> PGM .....IS THERE ANY FACILITY TO GIVE INPUT VALUES..BUT
> WITH THE H/W IT TAKES THE BATTERY CONDITIONS AS VALUES SAMPLES IT N
> CONVERTS.....BUT HOW DO I DO IT IN THE PROGRAM..
> ** HOW DO WE CALCULATE THE RESOLUTION FOR ADC.. SO AS TO CHECK THE
> VALUES.
> ** IN THE ANSEL REGISTER BITS3-0 R FOR ANALOG SELECT BITS
> 0= DIGITAL I/O ;PIN ASSIGNED TO PORT OR SPECIAL FUNCTION
> 1= ANALOG INPUT
> HOW CAN ADC HAVE A DIGITAL INPUT B'COS THE I/P HAS TO B ANALOG
> ** IN THE PWM MODULE WHAT VALUE SHOULD I MOVE TO T1CON .....I AM
> USING 1:1 PRESCALER AND INTERNAL CLOCK