10-bit adc to microcontroller

Thread Starter

digitsboy

Joined Dec 29, 2016
48
Hello,

I build a 10-bit adc and I want to connect it to a microcontroller.
I am trying to learn working with microcontrollers.

So now I have the problem which microcontroller do I need?
I found a 8 bit avr microcontroller with 2 times 8-bit i/o ports.
Can i connect the 10 digital outputs from my adc to the ports?
or do i need a 16-bit io?

I hope you can help me because it is a bit unclear for me!
thanks a lot
 
You can use 8-bit micro controller like ATMEGA 32 which supports 10bit ADCadc.PNG

There will be two 8 bit Registers name ADCH and ADCL from where you can get 10 bit values by shifting the bits.

ADC2.PNG
You need to just take a 16 bit variable and place ADCH first and shift it 8 time and then logical or it with ADCL and you will get the 10bit ADC value.
 

Thread Starter

digitsboy

Joined Dec 29, 2016
48
You can use 8-bit micro controller like ATMEGA 32 which supports 10bit ADCView attachment 146597

There will be two 8 bit Registers name ADCH and ADCL from where you can get 10 bit values by shifting the bits.

View attachment 146598
You need to just take a 16 bit variable and place ADCH first and shift it 8 time and then logical or it with ADCL and you will get the 10bit ADC value.
Thanks for your reaction! I don't want to use the internal adc, i want to use my own. So as I said before:

so for example I take this one: http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42719-ATmega1284P_Datasheet_Summary.pdf
can i use PB0 - PB7 and PA0 and PA1 for the adc?
 

nsaspook

Joined Aug 27, 2009
16,262
so for example I take this one: http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42719-ATmega1284P_Datasheet_Summary.pdf
can i use PB0 - PB7 and PA0 and PA1 for the adc?

if i use the shift register, I understand it uses less ports, but is it not influencing the speed? Does the shift register has more advantages?
If those pins can be configured for digital inputs and there also an additional conversion complete input pin (polled or interrupt) it should work.

The clock speed of the shift register interface is a design consideration if your sample speed is above a few thousand samples per second but serial clock speeds can easily be 20 MHz or more using common logic parts for >1M sample per second throughput. The problem is, can the controller handle such high speeds in serial or parallel port operation without added hardware like DMA for transfers.
 

Thread Starter

digitsboy

Joined Dec 29, 2016
48
If those pins can be configured for digital inputs and there also an additional conversion complete input pin (polled or interrupt) it should work.

The clock speed of the shift register interface is a design consideration if your sample speed is above a few thousand samples per second but serial clock speeds can easily be 20 MHz or more using common logic parts for >1M sample per second throughput. The problem is, can the controller handle such high speeds in serial or parallel port operation without added hardware like DMA for transfers.
One thing i am a bit worried about is that you have 2 times 8-bit ports. So for my 10-bit adc i have to read out the 8 ports from the first 8-bit io. This can be done with PORTB command. but i also need to read out 2 values from the other 8 bit pair. Can this be done at the same time? or do i get differences because of time?
 

nsaspook

Joined Aug 27, 2009
16,262
One thing i am a bit worried about is that you have 2 times 8-bit ports. So for my 10-bit adc i have to read out the 8 ports from the first 8-bit io. This can be done with PORTB command. but i also need to read out 2 values from the other 8 bit pair. Can this be done at the same time? or do i get differences because of time?
If the converted ADC data is held in a data latch (or doesn't change until another conversion is complete) until it's read then reading the lower/upper values sequentially in time won't matter.
https://www.allaboutcircuits.com/worksheets/latch-circuits/

Show us the complete design of your ADC if you want a good answer.
 
Top