Searching \ for '[pic]: A/D Conversion using interrupt ( PANIC ON )' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=a%2Fd
Search entire site for: 'A/D Conversion using interrupt ( PANIC ON )'.

Exact match. Not showing close matches.
PICList Thread
'[pic]: A/D Conversion using interrupt ( PANIC ON )'
2000\10\17@182154 by Andre Abelian

picon face
part 1 240 bytes content-type:text/plain; (decoded 7bit)

Hi to all,

I got bar graph meter done without A/D interrupt  enabled then
I decided to use A/D interrupt and I can't get ADCON0,ADIF flag set.
any help will highly appreciated.


see attached file
Andre


part 2 5386 bytes content-type:application/octet-stream; (decode)

part 3 135 bytes
--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use spam_OUTlistservTakeThisOuTspammitvma.mit.edu?body=SET%20PICList%20DIGEST




2000\10\17@183229 by Scott Dattalo

face
flavicon
face
On Tue, 17 Oct 2000, Andre Abelian wrote:

> Hi to all,
>
> I got bar graph meter done without A/D interrupt  enabled then
> I decided to use A/D interrupt and I can't get ADCON0,ADIF flag set.
> any help will highly appreciated.

Shouldn't you have this:

ADSERVICE:
               BTFSS   ADCON0,ADIF     ; A/D INTERUUPT
               RETFIE                  ; NO THEN IGNORE
               MOVF    ADRES,W         ; GET A/D VALUE
               andlw   0x7             ;there are only eight entries
               CALL    TABLE

You may be branching off into lala land.

Scott

PS. I think this is the second post on the piclist with actually pic code today!

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use .....listservKILLspamspam@spam@mitvma.mit.edu?body=SET%20PICList%20DIGEST




2000\10\17@184839 by Andre Abelian

picon face
Scott,

thanks for your replay
I just added andlw 0x7 and no help

Andre





{Quote hidden}

today!
>
> --
> http://www.piclist.com#nomail Going offline? Don't AutoReply us!
> use listservspamKILLspammitvma.mit.edu?body=SET%20PICList%20DIGEST
>
>
>
>
>

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use .....listservKILLspamspam.....mitvma.mit.edu?body=SET%20PICList%20DIGEST




2000\10\17@194137 by Dave Mumert

flavicon
face
Hi Andre
1 - It appears your interrupt goes to ADSERVICE: but returns through PULL.
Shouldn't your interrupt go to PUSH and then do a 'goto PULL' if it is not
the A/D interrupt

2 - Wouldn't it be easier to have the A/D interrupt routine restart the A/D
conversion cycle?  Maybe not relevant if the PIC is doing other things as
well.

3 - doing andlw 0x7 will give you the least significant bits from the A/D.
If you want the most significant bits you will need to do some more work
maybe,
 rrf         ADRES,F
 swap     ADRES,W
 andlw    7
 call        TABLE

It looks interesting and quite easy to expand to 16 LEDs.

Dave Mumert

----- Original Message -----
From: "Andre Abelian" <EraseMEengelecspam_OUTspamTakeThisOuTEARTHLINK.NET>
To: <PICLISTspamspam_OUTMITVMA.MIT.EDU>
Sent: Tuesday, October 17, 2000 5:09 PM
Subject: Re: [pic]: A/D Conversion using interrupt ( PANIC ON )


> Scott,
>
> thanks for your replay
> I just added andlw 0x7 and no help
>
> Andre

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use @spam@listservKILLspamspammitvma.mit.edu?body=SET%20PICList%20DIGEST




2000\10\17@201727 by Dan Michaels
flavicon
face
Andre Abelian wrote:
>Hi to all,
>
>I got bar graph meter done without A/D interrupt  enabled then
>I decided to use A/D interrupt and I can't get ADCON0,ADIF flag set.
>any help will highly appreciated.
>
>
>see attached file
>Andre
>
>Attachment Converted: C:\WIN31APP\SUPERNET\EUDORA\ATTACH\bargraph.asm
>

Andre,

Found these in your file:

               list p=16c74A
               #include        c:\mplab\p16c74A.inc

If you "are" using a PIC74, maybe try changing the following lines:

               BCF     ADCON0,ADIF     ; RESET A/D INIT FLAG (ADIF)
LOOP            BTFSC   ADCON0,ADIF     ; A/D OVER ?
               BTFSS   ADCON0,ADIF     ; A/D INTERUUPT
               BSF     INTCON,ADIE             ; ENABLE A/D INIT

to these:

               BCF     pir1,ADIF     ; RESET A/D INIT FLAG (ADIF)
LOOP            BTFSC   pir1,ADIF     ; A/D OVER ?
               BTFSS   pir1,ADIF     ; A/D INTERUUPT
               BSF     pie1,ADIE             ; ENABLE A/D INIT

also, check that you are re-initializing everything after this instr:

               CLRF    INTCON                  ; CLEAR ALL INTERRUPTS

also, is this a defined variable, or do you really mean < pir1 >?

UPDATE:         BCF     ADIF,6          ; RESET SOFTWARE A/D FLAG

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use KILLspamlistservKILLspamspammitvma.mit.edu?body=SET%20PICList%20DIGEST




2000\10\17@202339 by Alice Campbell

flavicon
face
The next thing to think about is scaling the ADC value to the
height of the bar.  You will need to divide the 8-bit value
by 8 to get the number of lights to light.  for example, a
value of 144decimal needs to light 144/(256/8) or 4.5 leds.
then the height of the bar is proportional to the adc value.

alice

{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use RemoveMElistservTakeThisOuTspammitvma.mit.edu?body=SET%20PICList%20DIGEST




2000\10\18@082110 by Olin Lathrop

flavicon
face
> I got bar graph meter done without A/D interrupt  enabled then
> I decided to use A/D interrupt and I can't get ADCON0,ADIF flag set.
> any help will highly appreciated.

The ADIF bit is in PIR1, not ADCON0.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, spamBeGoneolinspamBeGonespamcognivis.com, http://www.cognivis.com

--
http://www.piclist.com hint: To leave the PICList
TakeThisOuTpiclist-unsubscribe-requestEraseMEspamspam_OUTmitvma.mit.edu




More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...