LPC932 dual slope AtoD

Mar 05, 2006 10 Replies

Has anyone any practical experience of building a dual slope AtoD using a Philips P89LPC932 micro? I have read the Philips app note about this so it certainly seems possible. I don't need much resolution and a few samples per second would suffice - I am only reading the pots in a joystick on a wheelchair. The app note gives example code for a sigma delta method but that is unnecessarily complex for this application. Anyone have any dual slope application code for this micro they can share.



Ian


Two paths spring to mind:

- Look at the LPC935/938, and even the LPC9381 - these have ADCs almost for free.

- The PWMs in these devices make good DACs, and with a simple LPF, and the comparitor, you then create a tracking ADC. This can give over 8 bit precision, by dithering the DAC LSB, or you can weighted-parallel two PWMs, for very high precision DACs. We have done the latter using the Timer-Similar Atmel LP2052.

-jg

Yes, I looked at the 935. Unfortunately we have an mcb900 sbc with a 932 fitted and as a charity we prefer not to spend money if we can avoid it. In fact the 932 is soldered to the board so changing it means buying a complete board.

I had already thought of using one of the PWM outputs in the 932 for this. However, we need two PWM outputs for dc motor drives and it is not clear to me from the 932 data sheet if all four CCUs can be used independently.

Ian

Ian Bell schrieb:

I have done dual slope ADCs with several other '51 devices. This will surely be portable to the 932. You need several external parts (reference, integrator OP, multiplexer - cheapest parts like TL431, TLC272 and 4051 are OK). For details, you can contact me at info (a) autometer dot de.

Dipl.-Ing. Tilmann Reh http://www.autometer.de - Elektronik nach Maß.

Hi Ian,

have you considered the LPC935? with 8bit ADC or the LPC938 with 8bit ADC?

OR you have a bunch of LPC932(A1)'s on hand?

JG

I have just the one 932 in a Keil mcb900 board. I am doing this project for a charity so I have to keep costs to a minimum. I am sure it can be done - there's even a Philips app note but no code examples. I was hoping to short cut the work via an example or two.

Ian

I've often used dual slope and similar types to get 15 bits or so resolution at high accuracy, but for a joystick a single slope converter would probably be just fine. Create a voltage ramp, start it at time 0 and measure how long it takes to equal the voltage threshold with a hardware timer. Do it alternately with a reference voltage rather than the unknown and you can cancel out many of the analog errors (by calculating the quotient), but it's probably not necessary for a joystick.

Best regards, Spehro Pefhany

"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com

Thanks for the reply. I have seen accurate dual slope techniques used in weigh scales for example so as you say a simple single slope should do for my low resolution joystick. Thanks for confirming my own thinking.

Ian

And once again me ;-) Did you consider using the LPC935 or 938 basically the same device but with real AtoD. Afaik they are pin and code compatible.

Schwob

Ian Bell wrote:

Ian,

I wrote some code to scale a pot for a PIC16C84. It should be possible to use the technique.

I used it to read a joystick. It uses a ratio technique, so removes the component tolerence problems.

formatting link

Doug

Nice site Doug. I book marked an all that.

David

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required