when power on circuit, and measure the current at the same time, I found a spike. the normal current consumption is 15.8mA, while the peak current can get to 30mA. the spike duration is about 24 second. the start up time is only 2 second, after that, for every 100ms, the software just read temperature, and then calculate the required compensation voltage, finally output the voltage via DAC. no clock frequency changed, not get into idle or stop mode. why the current changed in that large range? Anyone can help me? thanks.
Can you tell me what you are measuring in the scope shot?
Is your power supply capable of supplying the correct start-up current needed? There is a great current demand on initial power up as you have to charge any caps connected to the supply. Also there can be a large current demand depending on what devices are being driven by the I/O lines of the processor. Current demand can also be higher due to higher clock rates, and memory usage conditions.
thank you for your reply.
we serial a small resistor in the power supply line, and measure the voltage drop with scope to monitor the current consumption.
the power supply capacity is more than enough. we do have some decoupling capacitor need be charged, but that may only require several mS. all the I/O was set to HZ except UART. i have not changed clock rate after start up. is the memory usage can cause 15mA supply current change?
i also calculate the current consumption except MCU, which shows MCU take off about 2mA at normal condition, but surged to 17mA after start up. the most strange thing is the current peak not occur at the beginning of start up. the current consume is normal at beginning, but continue go up and hit the peak at around 10 seconds, after that it will decrease slowly and back to normal after 20 seconds. during the 20 seconds, all the function is OK.
from the datasheet, only clock, I/O setting, flash erase/write may cause large supply current change, is there any other issues?
P.S. our application is bridge sensor compensation.
If you could send me your schematic, I might be able to see what is happening. When you first power the device, there are a number of things that take place both in regards to the digital portion and the analog portion. Once you have initialized your system, various sections of the device may power or change conditions. This would be especially true to the analog portion.
The way the waveform appears as a form of integrator, so I believe there is some form of charge state. Have you looked at your reference?
please see attached schematic. the analog section has been deleted since it will have no relationship with the digital section.
the function is simple: read on-chip temperature sensor -> generate two voltage according a formula to drive analog section-> read output from analog section and send out via Uart or I2C -> loop.
i believe it is not a integration problem, because when power off and on the circuit very quick during normal operation, the spike will occur again. also if i delete all function of software and just put a void loop, there is no spike.
things is getting very urgent since we are going to release this product, and everything is OK except this one. thank you.
In some cases you have digital portions connected to the analog supply. For example, the reset pin is tied to VCC and the SCL and RXD pins are tied to VCC through a pull-up. This has the potential of turning on the ESD diodes if there is more that 0.3V drop between supplies.
Analog inputs should also be connected to something (GND or VCC) and should not be left floating.
Potentially the biggest issue is the 20 ohm resistor (R2) between VCC and DVDD. After the MSC1213 starts the device reset, there will be a larger initial current draw. This current draw will cause a voltage drop across the R2 resistor. If the current is large enough there can be the problem I stated in the first paragraph.
I'm still confused as to where you are measuring the current draw. Is this on the VCC line? And what is the value of the resistor? The scope shot you sent earlier shows a 10mV scale. If you are measuring across R2, which would be the digital current draw, the numbers don't add up. So where exactly are you measuring your current in relationship to the schematic, and what is the resistor value used? And is the scope plot accurate to the voltage scale? If the measurement point is R2 I calculate the current to be 1.4mA and the max current to be 2.75mA. So how are you determining the current values?
I perfomed the measurement for my colleague. I connected a Fluke 187 in the ground line to the power supply in order to measure current. The current values reported are what I recorded off the Fluke display. I simply connected an oscilloscope across the inputs to the Fluke so I could capture the waveform. Apparently the Fluke has a series resistance of 1.8 ohms when in current mode.
So you are measuring total current for all devices, and not just the MSC1213?
Is there a way that we can isolate where the current is actually being drawn? It should be easy to measure the DVDD current as you could use the scope method across R2.
This is the current draw for the whole circuit, including our sensor element which is a four leg piezoresistive bridge with an input impedance of 4kohms.
I measured the voltage drop across the 20ohm R2 at turn-on with a Fluke 187. At turn-on it displayed 124mV. It gradually rose to 415 mV and then returned to 124mV steady state. This calculates to 6.2ma, 20.8ma, and 6.2ma respectively. The current across R2 followed the same timing that I had previously reported for the current in the whole circuit. The 5 volt VCC was rock solid at turn-on. The result was repeatable.
I then shorted out R2 and monitored the total current of the circuit. It started at 16.7 ma, peaked at 30.5 ma, and then stabilized back at 16.7 ma. It made no difference whether R2 was shorted or not.
I can repeat these tests to get scope traces if you like.
No need to take further scope shots at this time as you have demonstrated that the problem is isolated on the DVDD supply. I will have to set up some tests of my own and see what portion of the circuit may be drawing the current and why. Thanks for shorting out R2, as that eliminates the voltage drop across R2 as being a significant issue.
I will try to get these tests done in the next day or so and let you know what I find.
Here are some configurations in the
software, which may help you shot the problem.
1k bit flash was allocated as data flash.
P0,P1,P2,P3 are all set to input except
4MHz external clock source, divided by 4
before feed to system clock.
Internal reference enable, 2.5V
ADC buffer on, sampling rate is about 10Hz
DAC on (voltage mode)， update rate is also about 10Hz
Watch dog enabled
thank you for your help.
On my system I've been able to see something similar to your issue, except it my case the current is ramping up and down cyclically. At the start of your program, do you have any initialization loops with the DACs in which the output is changing throughout the ramp period? Is there any calculations or work being done withing that ramp period, or is the device idle? In my case there is an odd behaviour while the program is running a delay count cycle repeatedly. The current stabilizes once the program runs in a more continuous fashion.
Also, is there any way that you might share your code with me so I can take a look at your program?
I'm afraid i can not publish the detail code here. but i can make a detail description.
we change the DAC voltage every 0.1S according the temperature, and will change much (initialize) at the first time but less later. But as what you see in the schematic, a hundreds kohm resistor was series between DAC output and following circuit. so that should be not bring large current draw. at the same time, the RC time is far shorter than 10S. during the 20s ramp up and down time, the circuit works well, no problem except the current consumption. why running a delay count will cause large current change? is the timmer require a large current?
our software works as below:
set clock divider- clean memory-set all I/O, UART, set baud rate generate timmer, configure DAC and ADC, read data from ROM, and store to RAM. get into endless loop and wait for flag change (flag changed by the interrupt of ADC, 10sps). ADC interrupt service will store ADC data to RAM and change the flag bit. the endless loop will check the flag every loop, if setbit, calculate the DAC number from ADC result and data table. the endless loop also check RI bit for UART and reply accordingly. however, it is not important since we got the problem without any UART communication.
My colleague was able to resolve the current spike issue. His original configuration set all of the unused I/O's to high impedance. He has now discovered that setting the unused I/O's to high voltage with a weak pull up results in the current spike disappearing. Is this expected?
Glad you are seeing progress. I apologize that I was in too much of a hurry reading through the post. I went back and reread the configuration as I had missed the part about the digital lines being placed in an input configuration. Yes, having floating inputs can result in larger than usual current draw. On RESET, the ports are pulled high. When then placed as an input, with no source the pins, they will float. Eventually they may float to some value and stabilize, but this is not guaranteed.
Having a pull-up will stabilize the inputs to a proper value. The pull-ups will draw some current as the resistance is 9K, and there is a small leakage current. You might try setting the ports as outputs (possibly open-drain) to see which overall current draw gives you the best performance.
An open-drain output is also high impedance, so I made a bad assumption that was how the ports were set. Any input, either analog or digital, should connect to something somewhere. They should not be left floating.
i have tried open-drain setting, it still have current spike. i believe it is bug for your product, since the input setting should be high impedance as the data sheet. i'm thinking if we really want to input some swinging signal through I/O, and set the I/O as input, we may still face a unstable current supply.
anyway, thank you for your help.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.