Page 1 of 3

Potential analog reference voltage issue

Posted: Thu May 26, 2011 10:34 pm
by slacker.cam
Where can I find the list of changes required for Spin 2? Because I can't find the list I'm not sure if this has been covered yet or not...

I've been reading over the shematics for the spin 1 board over the past few evenings and I'm pretty much up to speed with what's going on. One potentially BIG issue that I've found is that your analog reference voltage (I'm assuming it's some of the pins 83-86 on the uC) are all connected to the 5V_microcontroller net (ie. the CPU voltage regulator) but all of the analog voltage divider networks are run from the 5V_switched net. This could cause issues if the regulators put out different voltages for whatever reason.

Ignore this if it's already been spotted and fixed.

Re: Potential analog reference voltage issue

Posted: Fri May 27, 2011 8:13 am
by Fred
This was intentional. The dividers and so on draw power, the cpu supply is supposed to be always on, and the docs spec that you can not have more than 0.? V of differential between the reference and the supply. Thus when the key is off, the reference would be zero and the supply 5 if the reference was attached to the same reg as the dividers. Or, the dividers would draw current when the car was "off" which is unnecessary.

What would your solution be? This is much the same as the other thread, really, mind if I move it there?

As for spin 2 changes, many (most?) have already been completed in git, and the list (50 or so long) was in git too, as far as i knew. Be careful, I know you're not the best with version control, there are two branches in the repo, make sure you're looking at the right one! :-) If you want to compare spin 1 with spin 2 then do two separate clones and checkout the appropriate branch in each so you can have both open at once.

Fred.

Re: Potential analog reference voltage issue

Posted: Mon May 30, 2011 6:05 am
by slacker.cam
I've just had a quick read through the datasheet and you're partially correct and partially wrong.

The dividers and whatnot should be powered down when the key is off - this is obvious/necessary. The reference voltage should be set to the same potential as the dividers however. The system would be totally cripplied if this wasn't the case - when I say system, I mean the A/D system, as I can think of a number of scenarios where you would never want the ref voltage to be within 0.3V of the supply voltage.

Anyway, you're right in saying that the A/D system needs to be powered from a potential of +-0.3V of the other supply pins. BUT the ref voltage does not. The datasheet specifies that this may be between -0.3 and 6.0V. So... Pin 85 should be connected to analog GND and pin 84 should be connected to analog VCC (ie. the same potential that the dividers/sensors are powered from). Pins 83 and 86 will be connected to the CPU power supply as they already are. Ideally the power for the whole analog subsystem should be either independant, or low pass filtered from the rest of the ECU.

Proof:
Image
This is much the same as the other thread, really, mind if I move it there?
Sorry, what thread do you mean?

Re: Potential analog reference voltage issue

Posted: Mon May 30, 2011 1:52 pm
by Fred
I guess that you're right. I had misread the document as saying there were limits on pin state, but it appears that it's only while operating that these limits apply:

Image

Cheers!

As for the thread, this stuff is all about always on, hence moving to the always on thread seems good, or maybe just cross linking is enough. Just trying to keep things organised.

In digging around for that info I found a lot of details which are going to be useful for implementing various things, including fine tuning a new hardware design. Thanks!

Fred.

Re: Potential analog reference voltage issue

Posted: Mon May 30, 2011 1:57 pm
by Fred
slacker.cam wrote:Ideally the power for the whole analog subsystem should be either independant, or low pass filtered from the rest of the ECU.
Look at the screeny I just posted, it shows that the ref voltages should be between the supply voltages, so I don't think it's OK to float it like that, as nice as it sounds.

Lastly, the only real downside to using the wrong reference would be that the two noise values (ref and signal) would sum and the peak to peak noise of the measurement would be worse. Whereas with the correct one, signal would fall as reference fell and the same count would be delivered, or close to it. Still, you appear to be right, thanks for your input. It's about fucking time you got involved, slacker! :-)

Fred.

Re: Potential analog reference voltage issue

Posted: Tue Jun 07, 2011 9:23 am
by nitrousnrg
This is interesting, back in that time the decision (my decision probably) to use that setup was to have a better reference.The MCU regulator has less current requirements, so its better sustaining a stable 5.0v than the big regulator, which can draw 1Amp or more, and is more subject to temperature and current drifts.

I believe that having a good reference is important, in fact, I don't discard the possibility of adding a 5.00v precision reference in that reference pin. This buggered me for a long time, I realize that many of the analog circuits depend on the crappy 5v, but I don't think leveling down the reference quality would be good. Also, as Fred pointed out, the upper reference can't be any voltage, which is weird, since afaik all the MCUs I used before could handle any voltage between VSS and VDD.

If you believe it is better to have a less stable 5v as a reference because the circuits would move up and down together, then cool; I'm keen to hear some thoughts :-)

Re: Potential analog reference voltage issue

Posted: Tue Jun 07, 2011 10:25 am
by Fred
nitrousnrg wrote: Also, as Fred pointed out, the upper reference can't be any voltage, which is weird, since afaik all the MCUs I used before could handle any voltage between VSS and VDD.
That isn't a hard limitation, it's a limitation for accuracy reasons.
If you believe it is better to have a less stable 5v as a reference because the circuits would move up and down together, then cool; I'm keen to hear some thoughts :-)
Consider TPS, just for example, TPS is a voltage divider between 0 and source, whatever source is. If source is 5.1 and TPS is at 100%, TPS is at 5.1 and the output is 1023 raw ADC count. If source is 5.1 and reference is 5.0, then TPS will show 100% when it is only at 95 or something. That's not cool.

On the other hand, if you consider battery voltage, you're measuring an unrelated figure, so the best reading will be given with the best reference, precision v reg ref would be good here.

So, what we see here is that it's application dependent.

I've got to ask, though, if the regulation quality from the regulator isn't very good, what the hell are we doing using it?

I imagine that it is sufficiently good. Certainly, what I see, in my logs, on multiple vehicles, with my Puma, is that the temperature readings are very stable, with only the lowest order bit fluctuating, and ONLY around the transistion point, which will always happen, to some extent. Having the thing effectively usable to the last bit is pretty nice, so I'd say that whatever is on it (looks, checks, LM2940T) is sufficiently accurate for our usage.

Fred.

Re: Potential analog reference voltage issue

Posted: Wed Jun 08, 2011 3:34 am
by nitrousnrg
Yes, the regulator is the best I could find, so its certainly a good regulation. Its not better than the small reg, though :-)

Well, so it stays as is.

Re: Potential analog reference voltage issue

Posted: Wed Jun 08, 2011 11:07 am
by Fred
nitrousnrg wrote:Well, so it stays as is.
Que? No entendido.

Re: Potential analog reference voltage issue

Posted: Wed Jun 08, 2011 11:38 am
by jharvey
You don't understand, let me clarify. You Fred commented
I've got to ask, though, if the regulation quality from the regulator isn't very good, what the hell are we doing using it?
You claim it does not have good regulation, however it is well regulated, so your comment is wrong. So Marco replied
Well, so it stays as is.
Fred you also noted that even if it does wonder, it's not important, as it's the same reference, so the scale will change any how. You have really been a pain about the regulator. Marco wants content, not wha wha wha. So he quickly and clearly noted it's going to stay, as it meets the design specs and the design specs are good.

Do you understand now? Or should I come out and say stop whining, your wasting our time with such chatter.