DEMOQE ADC pin selection?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

DEMOQE ADC pin selection?

1,706件の閲覧回数
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 返答(返信)

920件の閲覧回数
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 件の賞賛
返信

920件の閲覧回数
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 件の賞賛
返信