Maker Pro
Maker Pro

LPC932 dual slope AtoD

I

Ian Bell

Jan 1, 1970
0
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
 
I

Ian Bell

Jan 1, 1970
0
Jim said:
Two paths spring to mind:
- Look at the LPC935/938, and even the LPC9381 - these have ADCs almost
for free.

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.
- 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

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
 
T

Tilmann Reh

Jan 1, 1970
0
Ian said:
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.

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.
 
J

Joe G \(Home\)

Jan 1, 1970
0
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

Ian Bell

Jan 1, 1970
0
Joe said:
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?

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
 
S

Spehro Pefhany

Jan 1, 1970
0
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
 
I

Ian Bell

Jan 1, 1970
0
Spehro said:
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.

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
 
Top