DEMOQE ADC pin selection?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

DEMOQE ADC pin selection?

1,639 次查看
trav
Contributor III

I'm using a DEMOQE board and trying to setup the ADC on pin 18 of the header which is PTF0/ADP10.  I believe I have it setup right, but it reads a voltage of around 1.3V on that pin.  If I overdrive it to ground, my adc value will be 0, if I put voltage to it, it sources current like I'm shorting it.  Why is it doing this?

 

here is how I'm setting up the adc..

 

void InitADC(void) {    byte done = 0x00;  ADCSC1 = 0x0A;  ADCSC2 = 0x00;  ADCCFG = 0x04;    APCTL2 = 0x04; } void SetADC(byte adc_channel, byte aien_value) {  ADCSC1_AIEN = aien_value&0x01;  ADCSC1_ADCH = adc_channel;} //end SetADC

 Then my main looks like this:

 

void main(void) {  initSystems();  InitADC();  initLCD();  SetADC(0x0A,0x01);                      // ADC10, enable interrupt  EnableInterrupts;                       /* enable interrupts */       while(1){            ADCSC1 = 0x6A;//triggers adc         } }

Thanks,

Travis

标签 (1)
0 项奖励
回复
2 回复数

853 次查看
bigmac
Specialist III

Hello Travis,

 

What level of external voltage are you applying?  If it should exceed the Vdd voltage for the MCU, a substantial current may flow into the pin, with the potential to permanently damage the MCU.

 

At each I/O pin there is an intrinsic diode between the pin and Vdd, and it is this diode that conducts under these circumstances.  The pin current must not exceed the injection current limit specified in the datasheet. It is also possible for this current to raise the Vdd voltage level, above the maximum allowable limit.

 

Regards,

Mac

 

0 项奖励
回复

853 次查看
trav
Contributor III
Yup that was my problem, I was trying to feed it 5V when the MCU is running at 3V.  Also found out I needed to tie the ground of the DEMOQE board to the ground on the breadboard.
0 项奖励
回复