I did not look at your problem in detail, but there are some published errata relating to AtoD channel scanning. Did you check that these are not the cause of your problem? --- In lpc2000@yahoogroups.com, "douglasbolton" <doug@c...> wrote: > Hello > > I'm having problems getting correct readings on the AtoD pins. I have > 3 inputs which I'm converting individually under software control. I > drive one pin from a voltage follower with 2.26 volts. V3A is at 3.32 > volts. I expect an A/D reading of (2.26/3.32)*1023 = 696. The Atod > varies considerably depending on whether I read the pin on it's own > or cycle through the pins. Does anybody have schematic/details of the > analog input pins on the LPC2292. > I'd like not to use the voltage follower but am getting even less > stable readings without it. My source impedance is 4k7. What is the > input impedance of the pin? > > If I continually read just one pin using - > > ADCR_bit.SEL = 2; > ADCR_bit.START = 1; > while((ADDR & 0x80000000) == 0); > Result = ADDR; > ADCR_bit.START = 0; > Result = ((uint16_t)Result>>6); > > I get and AtoD value of 726 > > if I cycle through the 3 port pins using > > ADCR_bit.SEL = (0x01 << PortNum); > ADCR_bit.START = 1; > while((ADDR & 0x80000000) == 0); > Result = ADDR; > ADCR_bit.START = 0; > Result = ((uint16_t)Result>>6); > > I get and AtoD value of 790 > > > The voltages are all rock solid and I've set up the AtoD on the > LPC2292 as follows - > > uint32_t dummy; > > dummy = PINSEL2; > // set p2.31 as AIN5 (DEPTH pressure) > dummy |= 0x00400000; > // set p3.29 as AIN6 (AIR pressure) > dummy |= 0x00000040; > PINSEL2 = dummy; > // set up feedback pin > PINSEL1_bit.P0_28 = 0x01; > > // set off a single software controlled 10 bit conversion on a port > // pclk = 60 mhz > ADCR_bit.PDN = 0x01; > ADCR_bit.CLKDIV = 14;
Message
Re: AtoD pins
2004-11-04 by g2100g
Attachments
- No local attachments were found for this message.