I have setup the ADC and works great. However, no matter what I do, it
always accepts the ADC on the p2.0 pin. I am trying to read from P2.3, one read
at a time. Below is the init for the ADC:
P2DIR = 0xF7;
ADC10CTL0 = ADC10SHT_2 + ADC10ON + ADC10IE;
ADC10AE = 0x08;
Any ideas?
Thanks,
er Yalhoyalhi@oyal...
> Teksan Aletleri SAN. A.
> Tikveli Sok. No:4, 34055
> Rami, tanbul / TURKEY
> Tel: +90 (212) 613 22 00
> Fax: +90 (212) 544 70 35
> http://www.teksan.com.tr
>
About ADC
Started by ●May 11, 2004
Reply by ●May 11, 20042004-05-11
Hi er, It doens't look like you have initialized which pin you want to receive input on. You have to use ADC10CTL1 Control Register and select the input using the INCHx bits. INCHx Bits 15-12 Input channel select. These bits select the channel for a single-conversion or the highest channel for a sequence of conversions. 0000 A0 0001 A1 0010 A2 0011 A3 0100 A4 0101 A5 0110 A6 0111 A7 Hope that helps :). --- In msp430@msp4..., er Yalh<oyalhi@t...> wrote: > I have setup the ADC and works great. However, no matter what I do, it always accepts the ADC on the p2.0 pin. I am trying to read from P2.3, one read at a time. Below is the init for the ADC: > > P2DIR = 0xF7; > ADC10CTL0 = ADC10SHT_2 + ADC10ON + ADC10IE; > ADC10AE = 0x08; > > Any ideas? > > Thanks, > > er Yalh> oyalhi@t... > > Teksan Aletleri SAN. A. > > Tikveli Sok. No:4, 34055 > > Rami, tanbul / TURKEY > > Tel: +90 (212) 613 22 00 > > Fax: +90 (212) 544 70 35 > > http://www.teksan.com.tr > > > > >
Reply by ●May 11, 20042004-05-11
It does thank you, now it is working. I thought the ADC10AE did that but it does not. What does ADC10AE do then? _____ From: nepali_cool_man [mailto:nepali_cool_man@nepa...] Sent: Tuesday, May 11, 2004 8:39 PM To: msp430@msp4... Subject: [msp430] Re: About ADC Hi er, It doens't look like you have initialized which pin you want to receive input on. You have to use ADC10CTL1 Control Register and select the input using the INCHx bits. INCHx Bits 15-12 Input channel select. These bits select the channel for a single-conversion or the highest channel for a sequence of conversions. 0000 A0 0001 A1 0010 A2 0011 A3 0100 A4 0101 A5 0110 A6 0111 A7 Hope that helps :).
Reply by ●May 11, 20042004-05-11
--- In msp430@msp4..., er Yalh<oyalhi@t...> wrote: > I have setup the ADC and works great. However, no matter what I do, it always accepts the ADC on the p2.0 pin. I am trying to read from P2.3, one read at a time. Below is the init for the ADC: > > P2DIR = 0xF7; > ADC10CTL0 = ADC10SHT_2 + ADC10ON + ADC10IE; > ADC10AE = 0x08; > > Any ideas? > Hi "ADC10AE = 0x08;" only tells the micro which pins will be used as a special function (as opposed to general i/o). e.g if you want to use 2.2 and 2.3 you would input "ADC10AE = 0x0c;" You need to also tell it what ADC input channel to look at. e.g. " ADC10CTL1 |=INCH_3; Lance
Reply by ●May 12, 20042004-05-12
Lance thank you. I had downloaded the TI examples in one of the they used 2.4 for A/D; however, they did not uset the INCH_x. That example confused me, I thought I had to only setup the ADC10AE. However, now it is clear to me. Thank you and also thanks to "nepali_cool_man" Regards, Omer _____ From: Lance [mailto:lance@lanc...] Sent: Wednesday, May 12, 2004 2:41 AM To: msp430@msp4... Subject: [msp430] Re: About ADC --- In msp430@msp4..., Ömer Yalhý <oyalhi@t...> wrote: > I have setup the ADC and works great. However, no matter what I do, it always accepts the ADC on the p2.0 pin. I am trying to read from P2.3, one read at a time. Below is the init for the ADC: > > P2DIR = 0xF7; > ADC10CTL0 = ADC10SHT_2 + ADC10ON + ADC10IE; > ADC10AE = 0x08; > > Any ideas? > Hi "ADC10AE = 0x08;" only tells the micro which pins will be used as a special function (as opposed to general i/o). e.g if you want to use 2.2 and 2.3 you would input "ADC10AE = 0x0c;" You need to also tell it what ADC input channel to look at. e.g. " ADC10CTL1 |=INCH_3; Lance . <http://companion.yahoo.com>" target="_blank" rel="nofollow">http://rd.yahoo.com/SIG9q1j72e/M)5196.4901138.6071305.3001176/D=groups/S05005378:HM/EXP84405250/A!28215/R=0/SIGse96mf6/*http://companion.yahoo.com> click here <http://us.adserver.yahoo.com/l?M)5196.4901138.6071305.3001176/D=groups/S=:HM/A!28215/rand'6016184> _____ > .