DPRG
DPRG List  



DPRG: HC811E2 A/D converter

Subject: DPRG: HC811E2 A/D converter
From: garrett myrick gamyrick at linknet.kitsap.lib.wa.us
Date: Mon Jan 26 16:57:43 CST 1998

Hi,



Basically all I want to know is: How do you use the A/D converter system
on an hc811e2? I wrote a small program in Karl Lunt's Sbasic that first
sets the ADPU bit in the OPTION register, waits more than long enough for
the A/D system to power up, then writes a 0 to the ADCTL register to start
the conversion. It polls the ADCTL register until the CCF flag sets, and
then it is supposed to take the data in the ADR1 register and copy it to
port B where I am supposed to be able to see it on an LED bargraph. When I
loaded this program into the BOTBoard, nothing happened. I thought that it
was probably getting stuck in one of the loops. So what I did was to poke
a 1 to port B in the first loop, and after it got out of the loop it would
clear port B. The second loop would write a two, etc., so that I could see
where it was getting stuck. I loaded these changes, and found out that it
was getting stuck in the first loop, which meant that the CCF flag never
set, which probably means that no conversion ever took place. I have
looked through the  Motorola reference manual (the one specifically for
the E series, not the pink book), and can't seem to find out what the
problem is. What am I doing wrong?

Thanks,

Garrett Myrick
<gamyrick at linknet.kitsap,lib.wa.us>

------------------------------

More information about the DPRG mailing list