The  A/D  Converter



    A really neat feature of Motorola's
68HC11 is the ADC (analog to digital converter).  This is an 8-bit, 8-channel converter which is excellent for most robotic applications.  In order to use this, there are a few steps:

1.) Turn the ADC on by poking a hexadecimal 80 to address 0x1039

2.) Wait a few micro-seconds

3.) Poke the number of the AD pin to address 0x1030 (say poke a 4 if you want the                        value of PE4, a 6 to get the value of PE6, etc.)

4.) Wait until bit7 at 0x1030 is set (WCC11 includes a special command for this  called 'AD_delay()')

5.) Look at the correct register to see what the value is, here they are:


PIN                          0x1030                                REGISTER  ADDRESS

0                                  0                                                  0x1031
1                                  1                                                  0x1032
2                                  2                                                  0x1033
3                                  3                                                  0x1034
4                                  4                                                  0x1031  *
5                                  5                                                  0x1032  *
6                                  6                                                  0x1033  *
7                                  7                                                  0x1034  *



*    only available on 52-pin micros


    Note that there are only 4 registers, and that PE4 - PE7 are only available in the 52-pin HC11 (the types with an 'FN' at the end of the chip number).

    That's all there is to it.


Home Page  |  Walt's Page