Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
8XC196Kx,8XC196Jx,87C196CA microcontroller family user's manual.1995.pdf
Скачиваний:
57
Добавлен:
23.08.2013
Размер:
3.97 Mб
Скачать

8XC196Kx, Jx, CA USER’S MANUAL

11.4.4 Programming the A/D Command Register

The A/D command register controls the operating mode, the analog input channel, and the conversion trigger.

AD_COMMAND

Address:

1FACH

 

Reset State:

C0H

The A/D command (AD_COMMAND) register selects the A/D channel number to be converted, controls whether the A/D converter starts immediately or with an EPA command, and selects the conversion mode.

7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

 

M1

 

 

M0

 

 

GO

 

ACH2

 

ACH1

 

ACH0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bit

Bit

 

 

 

 

 

 

 

Function

 

 

 

Number

Mnemonic

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7:6

Reserved; for compatibility with future devices, write zeros to these bits.

 

 

 

 

 

 

 

 

 

 

5:4

M1:0

A/D Mode (Note 1)

 

 

 

 

 

 

 

 

 

 

These bits determine the A/D mode.

 

 

 

 

 

 

 

 

M1

M0

Mode

 

 

 

 

 

 

 

 

 

 

0

 

0

 

10-bit conversion

 

 

 

 

 

 

 

 

0

 

1

 

8-bit conversion

 

 

 

 

 

 

 

 

1

 

0

 

threshold detect high

 

 

 

 

 

 

 

 

1

 

1

 

threshold detect low

 

 

 

 

 

 

 

 

 

 

 

 

 

3

GO

A/D Conversion Trigger (Note 2)

 

 

 

 

 

 

 

 

Writing this bit arms the A/D converter. The value that you write to it

 

 

 

determines at what point a conversion is to start.

 

 

 

 

 

 

1

= start immediately

 

 

 

 

 

 

 

 

 

 

0

= EPA initiates conversion

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2:0

ACH2:0

A/D Channel Selection

 

 

 

 

 

 

 

 

 

 

Write the A/D conversion channel number to these bits. The 87C196CA,

 

 

 

8XC196Jx devices have six A/D channels, numbered 2–7. The

 

 

 

 

8XC196Kx devices have eight channels, numbered 0–7.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

NOTES:

1.While a threshold-detection mode is selected for an analog input pin, no other conversion can be started. If another value is loaded into AD_COMMAND, the threshold-detection mode is disabled and the new command is executed.

2.It is the act of writing to the GO bit, rather than its value, that starts a conversion. Even if the GO bit has the desired value, you must set it again to start a conversion immediately or clear it again to arm it for an EPA-initiated conversion.

Figure 11-5. A/D Command (AD_COMMAND) Register

11-8

Соседние файлы в предмете Электротехника