EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Help needed getting Aout working on LPC2468

Started by Martijn Broens January 5, 2009
--- In l..., "gabdubatti" wrote:
> Hi,
>
> I still have problems with DAC and ADC modules on my board.
> I have tested 3 CPUs and I allways get the same results.
>
> I have checked my design and all seems to be OK
> (Ethernet and external memory access is working fine).
> As far as I know, for ADC/DAC operation only 3 other pins are related:
> VDDA (pin 20), VSSA (pin 22) and VREF (pin 24).
>
> I removed the noise filters from VSSA/VDDA (just in case).
> My uP is an LPC2468 FBD208 (rev.B) with VREF = VDDA = 3.3V / VSSA=VSS / a 10K resistor between P0.26 and VSSA.
> P0.230[0]= 3.3V/2
> P0.240[1]= 3.3V/2
> This is my test code:
> ---------------------
> unsigned long newv;
> newv= 0x00008000L;
> DACR= newv;
> printf( "\nDACR:%08X->%08X - ", newv, DACR );
>
> printf( "PINSEL1=%08X (P0.26=%d)\n", PINSEL1, (PINSEL1 >> 20) & 3 );
> printf( "PCLKSEL0=%08X (DAC=%d, ADC=%d)\n", PCLKSEL0, (PCLKSEL0 >> 22) & 3, (PCLKSEL0 >> 24) & 3 );
> printf( "AD0DR0=%08X AD0DR1=%08X\n", AD0DR0, AD0DR1 );
> And this is what I get:
> -----------------------
> DACR:00008000->00000000 - PINSEL121403C (P0.26 function=2)
> PCLKSEL0U515555 (DAC clk=1, ADC clk=1)
> AD0DR000000 AD0DR100000
> Note that DACR dosen't change its value and allways returns 0 and
> AD0DR0 and AD0DR1 complete the conversion and also returns 0.
> The ADC module is in burst mode running at 4.24MHz (this works fine
> in my E.A. board). The ADC is turned on (in PCONP) and the DAC is allways on.
>
> This seems to me like an electrical or CPU problem.
> I have checked these 3 pins a hundred of times with an oscilloscope
> and a voltimeter.
> I have also post this issue to NXP to see is my CPU have a mask problem...
>
> Any help or idea will be apreciated.
>
> Best Regards,
> Gabriel.
>

Hi Gabriel,

Have you checked the DBGEN pin already? It must be pulled high for the ADC to work (not sure about DAC at the moment).

DBGEN=0 brings the JTAG TAP in Boundary Scan mode. Everything will work normally, except the ADC(/DAC)...

Regards,
Rolf

An Engineer's Guide to the LPC2100 Series

--- In l..., "rolf_meeser" wrote:
>
> --- In l..., "gabdubatti" wrote:
> > Hi,
> >
> > I still have problems with DAC and ADC modules on my board.
> > I have tested 3 CPUs and I allways get the same results.
> >
> > I have checked my design and all seems to be OK
> > (Ethernet and external memory access is working fine).
> > As far as I know, for ADC/DAC operation only 3 other pins are related:
> > VDDA (pin 20), VSSA (pin 22) and VREF (pin 24).
> >
> > I removed the noise filters from VSSA/VDDA (just in case).
> > My uP is an LPC2468 FBD208 (rev.B) with VREF = VDDA = 3.3V / VSSA=VSS / a 10K resistor between P0.26 and VSSA.
> > P0.230[0]= 3.3V/2
> > P0.240[1]= 3.3V/2
> >
> >
> > This is my test code:
> > ---------------------
> > unsigned long newv;
> > newv= 0x00008000L;
> > DACR= newv;
> > printf( "\nDACR:%08X->%08X - ", newv, DACR );
> >
> > printf( "PINSEL1=%08X (P0.26=%d)\n", PINSEL1, (PINSEL1 >> 20) & 3 );
> > printf( "PCLKSEL0=%08X (DAC=%d, ADC=%d)\n", PCLKSEL0, (PCLKSEL0 >> 22) & 3, (PCLKSEL0 >> 24) & 3 );
> > printf( "AD0DR0=%08X AD0DR1=%08X\n", AD0DR0, AD0DR1 );
> >
> >
> > And this is what I get:
> > -----------------------
> > DACR:00008000->00000000 - PINSEL121403C (P0.26 function=2)
> > PCLKSEL0U515555 (DAC clk=1, ADC clk=1)
> > AD0DR000000 AD0DR100000
> >
> >
> > Note that DACR dosen't change its value and allways returns 0 and
> > AD0DR0 and AD0DR1 complete the conversion and also returns 0.
> > The ADC module is in burst mode running at 4.24MHz (this works fine
> > in my E.A. board). The ADC is turned on (in PCONP) and the DAC is allways on.
> >
> > This seems to me like an electrical or CPU problem.
> > I have checked these 3 pins a hundred of times with an oscilloscope
> > and a voltimeter.
> > I have also post this issue to NXP to see is my CPU have a mask problem...
> >
> > Any help or idea will be apreciated.
> >
> > Best Regards,
> > Gabriel.
> > Hi Gabriel,
>
> Have you checked the DBGEN pin already? It must be pulled high for the ADC to work (not sure about DAC at the moment).
>
> DBGEN=0 brings the JTAG TAP in Boundary Scan mode. Everything will work normally, except the ADC(/DAC)...
>
> Regards,
> Rolf
>

IT WORKS!!
That was the problem :-)
Thanks a lot Rolf!
Best Regards,
Gabriel.

The 2024 Embedded Online Conference