Reference Voltage input on Nano54415
-
- Posts: 624
- Joined: Mon May 12, 2008 10:55 am
Reference Voltage input on Nano54415
On a NANO54415, we are providing 2.5V on the VDDA_DAC_ADC input (pin 7) as a reference voltage for the analogs. The
driver is an MC34074VDG op amp. But the Nano is loading the input voltage and pulling it down to 2.0V.
I've looked through the Reference Manual (MCF54415RM.pdf) and all it says is that the reference source needs to be able to
provide 1ma of reference current, which that op amp is capable of delivering.
Is there something else I'm missing?
driver is an MC34074VDG op amp. But the Nano is loading the input voltage and pulling it down to 2.0V.
I've looked through the Reference Manual (MCF54415RM.pdf) and all it says is that the reference source needs to be able to
provide 1ma of reference current, which that op amp is capable of delivering.
Is there something else I'm missing?
Re: Reference Voltage input on Nano54415
I would verify the op amp circuit. Disconnect from the vref input and try a 1.2k resistor to ground, which would provide twice the current you say you need. Make sure the voltage does not droop. Also look at the output with a scope, is is a steady dc or is there noise or oscillation? If you are only checking with a volt meter it will average things out. I'm not an expert in voltage references. Why use an op amp instead of a voltage reference component?
-
- Posts: 624
- Joined: Mon May 12, 2008 10:55 am
Re: Reference Voltage input on Nano54415
The reference is a 2.5V zener diode pulled up to 5V through a resister. That is fed into a unity gain op amp to provide the
necessary drive current. The Reference Manual says the reference source needs to provide at least 1ma of reference current.
Yes, we have probed the voltage with a scope, it's nice and clean. I should add that the reference voltage doesn't drop
immediately on turn-on. When first power-up, the voltage is at 2.5V at the input of the Nano, pin 7. But after 10-15 seconds,
the voltage slowly decays down to 2.0V. It's as if something was turning on that needed more current. Could there be some
default initialization going on that causes this?
necessary drive current. The Reference Manual says the reference source needs to provide at least 1ma of reference current.
Yes, we have probed the voltage with a scope, it's nice and clean. I should add that the reference voltage doesn't drop
immediately on turn-on. When first power-up, the voltage is at 2.5V at the input of the Nano, pin 7. But after 10-15 seconds,
the voltage slowly decays down to 2.0V. It's as if something was turning on that needed more current. Could there be some
default initialization going on that causes this?
-
- Posts: 624
- Joined: Mon May 12, 2008 10:55 am
Re: Reference Voltage input on Nano54415
As I mentioned, the reference voltage is at 2.5V on power-up, and drops to 2.0V after several seconds. The 10-15 seconds
I mentioned is incorrect. It's more like 3-5 seconds. And when I hit reset or power cycle, the reference voltage pops back
up to 2.5V for a few seconds, then drops to 2.0V.
This morning I commented out statement StartAD(), reloaded the program, and now the reference stays at 2.5V. Of course
I can't get any analog conversions, but the reference stays where its supposed to.
Perhaps this is a software issue and should be moved to the software forum. Would it be worth while to see the analog
initialization code?
I mentioned is incorrect. It's more like 3-5 seconds. And when I hit reset or power cycle, the reference voltage pops back
up to 2.5V for a few seconds, then drops to 2.0V.
This morning I commented out statement StartAD(), reloaded the program, and now the reference stays at 2.5V. Of course
I can't get any analog conversions, but the reference stays where its supposed to.
Perhaps this is a software issue and should be moved to the software forum. Would it be worth while to see the analog
initialization code?
Code: Select all
// Initialize onboard ADC channels.
InitSingleEndAD();
sim2.adc.sdis = 0x0E0; // Disable ADC channels 5,6,7.
// Initialize onboard DAC channels. See MCF54415RM.pdf, ch 10, pg 239.
sim1.ccm.misccr2 &= ~(MISCCR2_ADC3EN | MISCCR2_ADC7EN ); // Disable ADC3 & ADC7 functions.
sim1.ccm.misccr2 |= (MISCCR2_DAC0SEL | MISCCR2_DAC1SEL); // Enable DAC0 & DAC1 output drive.
sim2.dac[0].cr &= ~DAC_CR_PDN; // Enable DAC0 output. (See pg 801 of above manual)
sim2.dac[1].cr &= ~DAC_CR_PDN; // Enable DAC1 output
//StartAD();
Re: Reference Voltage input on Nano54415
The nanao is pin limited. So AVCC and and reference are tied together. (We've done this on most or our products with A/D)
So Vref must be 3.3V and it must have enough current to power the analog section as its running both the VREF and the AVCC
The appropriate bit of the nano schematic is attached...
So Vref must be 3.3V and it must have enough current to power the analog section as its running both the VREF and the AVCC
The appropriate bit of the nano schematic is attached...
- Attachments
-
- NanoAD.png (125.11 KiB) Viewed 8726 times
-
- Posts: 624
- Joined: Mon May 12, 2008 10:55 am
Re: Reference Voltage input on Nano54415
Ok. We can do that. I will need to do some rework to get 3.3V to that pin. Do you have an idea of how much current I
need to supply? The op amp I'm currently using for the 2.5V can supply 10ma, and it's getting loaded down. That would
suggest I need to supply more that 10ma.
need to supply? The op amp I'm currently using for the 2.5V can supply 10ma, and it's getting loaded down. That would
suggest I need to supply more that 10ma.
Re: Reference Voltage input on Nano54415
One trick if oyu have extra A/D channels is to tie your 2.5V ref to an A/D in and then just tie the
A/D ref AVCC to 3.3V Vcc.... it wount be a precise refernce, but measuring the actual reference with the spare A/D will let you adjust...
A/D ref AVCC to 3.3V Vcc.... it wount be a precise refernce, but measuring the actual reference with the spare A/D will let you adjust...
-
- Posts: 624
- Joined: Mon May 12, 2008 10:55 am
Re: Reference Voltage input on Nano54415
Ok, I now have hardware. The A/D Reference is now tied to 3.3V. Here is the test code:
The problem is I don get meaningful results. If ground an A/D input, I get a count that bounces between 392 and 520. The count should be about 86 and much more stable. If I put 2.6V into an A/D channel, I get a count that bounces between 2304 to 2360. It should be a count of about 3226. All channels show the same results. Is there something else I need to do?
InitSingleEndAD();
StartAD();
while( 1 ) {
if ( ADDone() ) {
for ( BYTE i=0; i<5; i++ ) {
internal_adc_count = GetADResult(i) & 0x0FFF;
}
iprintf("%4d, %4d, %4d, %4d\r\n", internal_adc_count[0], internal_adc_count[1], internal_adc_count[2], internal_adc_count[3] );
StartAD();
}
OSTimeDly(20);
}
The problem is I don get meaningful results. If ground an A/D input, I get a count that bounces between 392 and 520. The count should be about 86 and much more stable. If I put 2.6V into an A/D channel, I get a count that bounces between 2304 to 2360. It should be a count of about 3226. All channels show the same results. Is there something else I need to do?
Re: Reference Voltage input on Nano54415
Congratulations on the new hardware. What I usually do when this occurs is test the same code on the my development kit (in this case the NetBurner development kit) and see if there is a difference. If it works correctly on the dev kit and not your h/w, then you know where to look first to see what differences there may be. ADC conversions are a ratio of the ADC reference to the ADC channel input. If your reference is bouncing around, so will your readings.
-
- Posts: 624
- Joined: Mon May 12, 2008 10:55 am
Re: Reference Voltage input on Nano54415
No, the 3.3V is not changing. It's right off the power supply and is the same voltage that powers the NANO board. We just jumpered the NANO Vcc on pin 17 to the DAC_ADC reference input, pin 17. Plus the two DAC channels work fine. I can generate a nice saw tooth from 0 to 3.2V.