Question about the registers of an ADC

adcregister

There are two things that confuses me in the below text:

"The ADC uses the successive-approximation method to perform the
conversion.The HCS12 uses two 8-bit registers to hold a ananlog to digital conversion result. The result can be stored either right- or left-justified. The A/D conversion is performed in a sequence from one to eight samples."

1- I always thought that registers are storage locations in the CPU. So ADCs would have their own registers too?

2- What are the functionality and meaning of the right- or left-justified registers?

Best Answer

I always thought that registers are storage locations in the CPU. So ADCs would have their own registers too?

Registers can be storage locations in any device. You'll find the in ADCs, accelerometers, EEPROMs, etc.

What are the functionality and meaning of the right- or left-justified registers?

This implies that the result is less than the 16 bits allocated to it. Suppose the ADC produces a 12 bit result. In the left justified case, it would be shifted to the so the MSB is in the MSB of the 16 bit space, like so:

16         |3|2|1|0
MSB|...|LSB|X|X|X|X

Right justified is the reverse, where the LSB is in the LSB of the 16 bit space.

16|15|14|13|12 |   |0
X | X| X| X|MSB|...|LSB