Maker Pro
Maker Pro

8051 internal adc

burassu

Jul 1, 2011
36
Joined
Jul 1, 2011
Messages
36
Hi I am using th internal adc of the 8051 mcu . I need to use all the pins of port 1 as adc. But for a specific function I need to use pin 1.1 , for another function ,pin 1.2 ......

Is there any code to initialize each pin as an internal adc ??

Tnks
 

OLIVE2222

Oct 2, 2011
690
Joined
Oct 2, 2011
Messages
690
Hi,

The 8051 don't have any ADC. You maybe use an improved µC based on 8051 core. Please specify the exact IC reference.

Olivier
 

OLIVE2222

Oct 2, 2011
690
Joined
Oct 2, 2011
Messages
690
According to the uC data sheet here under (page 87) "The channel select bit in ADCF register define which ADC channel/port1 pin will be used as ADCIN. The remaining ADC channels/port1 pins can be used as general purpose I/O"

http://www.keil.com/dd/docs/datashts/atmel/t89c51ac2.pdf

You you maybe have a look on the ADCF register value generated by your code.

Olivier
 

burassu

Jul 1, 2011
36
Joined
Jul 1, 2011
Messages
36
ADCF

Therfore if I write ADCF = 0x01; means that I am using pin1.0?
 
Top