Re: Something to ponder
From: Ken Smith (kensmith_at_green.rahul.net)
Date: 10/03/04
- Next message: Fred Bloggs: "Re: Why DC instead of AC for power transmission?"
- Previous message: Product developer: "Re: OT: Cheney and Disarming American Defense- THE Facts"
- In reply to: nospam: "Re: Something to ponder"
- Next in thread: Spehro Pefhany: "Re: Something to ponder"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 3 Oct 2004 16:47:01 +0000 (UTC)
In article <fgvul0l3odaa0ndgi2duqhb5i2j6omlojk@4ax.com>,
nospam <nospam@nospam.invalid> wrote:
[... me ...]
>> 65536 * Vin / (2 * Vref)
>>
>>
>>You can make the main loop of the code do it.
>
>This is a crude (or elegant depending on how you look at it) delta sigma
>converter. Your maths isn't right.
I think my math may be better than my typing in this case. But it was a
good catch on your part and yes it isn't very linear. I was using Vref=5V
and the input as about 10V as the point that mattered.
As for this being crude (or elegant), I take it more as "good enough". In
the cases I used it, I was checking the battery voltage. I just needed to
know the voltage of the lead acid is above 10.5V and give a little warning
as it went down. For that it was good enough.
I'm making a slight change to your design below:
>If you did this
>
>
> KR
> Vin -/\/\/\------
> !
> R ! ! \
> ----/\/\/\---------------!+ \
> ! ! ! ------- TooHi to CPU
> !!- ---C ---!- /
> Ton ----!! --- ! ! /
> !!- ! !
> ! ! REF
> GND GND
>
With the change I made, the circuit is now good for from Vref to
(K+1)Vref. If I'd though of your circuit with this change, it is likely I
would have done this instead. Adjusting K to get the top of the span 15V
and using the +5V supply as Vref, it would work quite a bit better. Not
that better was really needed in my case.
>With either circuit you should also note that the loop execution time must
>be constant although a bit of jitter which is not dependant on the state of
>TooHi would average out I suppose.
Even if the state of TooHi changes the loop time a little, you can correct
for this in the scaling so no-one notices.
I my case, the loop went around 176.00 times per second.
>I would be suprised if this isn't in a PIC application note somewhere.
>Don't some PICs have a reference, comparator and open drain output?
Others have an ADC so maybe they don't suggest ways to not use the ADC.
-- -- kensmith@rahul.net forging knowledge
- Next message: Fred Bloggs: "Re: Why DC instead of AC for power transmission?"
- Previous message: Product developer: "Re: OT: Cheney and Disarming American Defense- THE Facts"
- In reply to: nospam: "Re: Something to ponder"
- Next in thread: Spehro Pefhany: "Re: Something to ponder"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|