Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/25/03 06:52
Read: times


 
#40009 - This has me puzzled. (A/D code problem)
I have a Philips 80c552 and I am trying to use the A/D converter using an interrupt to read the ADCH 10-bit result and to clear the ADCI bit.

My code looks something like this:

ljmp main
.org 0x8053
ljmp adc_intr
main:
mov ie,#0xd2 ; (enables global, adc, serial, and timer0 interrupts)
mov r7,#0xff
mov adcon,#0x08
loop:
cjne r7,#0x00,loop

adc_intr:
mov a,adch
rl a
rl a
mov r2,a
anl a,#0x03
mov r1,a
mov a,adcon
rl a
rl a
anl a,#0x03
orl 0x2,a
mov r7,#0x00
mov adcon,#0x00
reti

Bascially, the cjne r7,#0x00,loop instruction never falls through. Am I doing something wrong with interrupts?

thanks
-Keith


List of 7 messages in thread
TopicAuthorDate
This has me puzzled. (A/D code problem)            01/01/70 00:00      
   RE: This has me puzzled. (A/D code problem)            01/01/70 00:00      
   RE: This has me puzzled. (A/D code probl            01/01/70 00:00      
      If I set bit 3 of ADCON,            01/01/70 00:00      
         RE: If I set bit 3 of ADCON,            01/01/70 00:00      
            I figured out what was wrong...            01/01/70 00:00      
               RE: I figured out what was wrong...            01/01/70 00:00      

Back to Subject List