Any Arduino nerds?

I'm having an Arduino problem that's so strange that I'm at a loss to understand it. I posted on the Arduino Forum, but didn't get much interest.

Anyway, I have a two-year-old Arduino Pro Mini clone, the 3.3V 8MHz version, from which I have removed the voltage regulator and the power-on indicator LED. And since the Pro Mini doesn't even have a UART adapter, the modified Mini is now really just the processor. I power it directly from an 18650, and that works fine. But the key to success is that when

which is in the neighborhood of what the datasheet predicts. So the battery lasts a long time.

Last week I received two new Pro Minis from a different source, but they look identical to the old one - same PCB, same silkscreen even. I removed the LED and regulator from one of them, flashed my sleep current test sketch to it, then measured the sleep current with Vcc at 3.3V.

Well I though it might be a leaky cap or something, but first I used AvrDude to confirm that the bootloader and fuse settings were standard stock, just like the old Mini. Then I did the same modification to the second new Mini, and measured the sleep current. It also came in at

behaving like a 22K resistor from Vcc to ground, but there is no such resistor on any of the Minis.

The processor on all of them is the AtMega328P, At least that's what the markings say. But it seems to me that the problem almost has to be in the processor, yet that doesn't seem logical.

I'll reproduce my very short sketch below for the 328P in case anybody else wants to measure their processor-only deep sleep current.

I don't understand how the exact same sketch, circuit, processor, fuses and bootloader can produce such different results. At the same time, I don't think it's likely to be a bad part on the board else the current wouldn't be the same on the two new Minis. So I don't know what I'm dealing with. Do the two new Minis have couterfeit processors? I haven't heard of that being a problem with the AVR parts.

So I'm stumped. I don't really have the rework capabilty to switch the processors, and I don't know whether I should order yet another batch of Minis.

Well, if anyone comes up with an explanation, please post. Thanks very much for any ideas.

#include #include int i;

void setup(){

for (i = 2; i < 20; i++) { // all GPIO pins to a rail pinMode(i,OUTPUT); digitalWrite(i,LOW); } ADCSRA = 0; // disable ADC for power saving wdt_disable(); // disable WDT for power saving set_sleep_mode (SLEEP_MODE_PWR_DOWN); // Deep sleep sleep_enable(); sleep_bod_disable(); // disable brownout detector sleep_cpu(); // now go to sleep

}

void loop(){ }

Reply to
Peabody
Loading thread data ...

?,

is is

Oh boy I've used an andrino, but I have no idea. I'd say order some more. (more data) If you are soldering - desoldering things are you keeping yourself grounded. Electrostatics might blow out some protection part on some input. (just a WAG)

George H.

Reply to
George Herold

Try this one:

#include #include

void sleep(){ delay(100); sleep_enable(); set_sleep_mode(SLEEP_MODE_PWR_DOWN); //set sleep mode

// disable ADC ADCSRA = 0;

power_adc_disable(); power_spi_disable(); power_timer0_disable(); power_timer1_disable(); power_timer2_disable(); power_twi_disable();

byte i; for (i = 0; i

Reply to
bitrex

Thanks very much, but I get exactly the same result as with

with the new one.

It's enough the make you wanna spit.

Reply to
Peabody

ct

es

I would ask what a ? is. This is showing up as a character from an Asian language. Should I guess this is microamps normally indicated by uA ? I'm guessing there is something about the message encoding that is turni ng a Greek mu character to what I am seeing?

I don't know a lot about this processor, but it has "fuses" to control aspe cts of the CPU such as internal vs. external clocking. Could it be that so mething is "fused" differently that leaves some hardware feature of the new units in an active state? For example is there a brown out circuit that r equires a reference or maybe something with the clocking? Not everything c an be controlled from the code.

I'm not even sure if the "fuses" actually fuses or if they are reprogrammab le. I'm thinking "fuses" is just a hold over term and they are a bit of fl ash memory.

--

  Rick C. 

  - Get 1,000 miles of free Supercharging 
  - Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C

examining the message I see no reason why it should come out that way.

--
  Jasen.
Reply to
Jasen Betts

It's the character mu, so it's microamps. It was entered as ALT 230 on my Windows keypad, and looks like a mu on my news reader. But I'll use uA in the future.

No. I've read out the fuse settings on the old and new Minis, and they are identical, and are the same as the stock settings for the Mini. Same for the bootloader.

Reply to
Peabody

If you're going to do that you should set some extra headers

Mime-Version: 1.0 Content-Type: text/plain; charset=WIN-1252 Content-Transfer-Encoding: 8bit

yeah, or that.

--
  Jasen.
Reply to
Jasen Betts

pects of the CPU such as internal vs. external clocking. Could it be that something is "fused" differently that leaves some hardware feature of the n ew units in an active state? For example is there a brown out circuit that requires a reference or maybe something with the clocking? Not everything can be controlled from the code.

able. I'm thinking "fuses" is just a hold over term and they are a bit of flash memory.

Fuses are programmable flash bits (preserved after power cycle)

Sleep Mode Control Register (SMCR.SE), from AVR code, selects one of severa l states:

Idle Mode Power Down Power Save Standby Extended Standby

The only fuse that would affect power consumption is DWEN: If the On-chip debug system is enabled by the DWEN Fuse and the chip enters sleep mode, the main clock source is enabled and hence always consumes pow er. In the deeper sleep modes, this will contribute significantly to the to tal current consumption.

Reply to
edward.ming.lee

formatting link

Page 260 of the data sheet give DC characteristics in section 28.3.

At 3V the power down mode draws less than 44uA with the WDT enabled or 40uA with it disabled.

There seems to be six power down modes, just to make life interesting.

Leakage currents are frequently specified as the lowest current it is easy to measure, which leaves the manufacturer free to make fairly dramatic changes in processing. Even so, 0.4uA seems improbably low, and 150uA is way over specification.

--
Bill Sloman, Sydney
Reply to
Bill Sloman

?,

is is

Make sure all the I/O ports are not programmed with pull-up resistors. Aga in, you probably need to do it in AVR codes.

Reply to
edward.ming.lee

But they aren't.

Have you checked all the pins with an oscilloscope to see if any pin voltages are different between the two version, or floating?

Cheers, James Arthur

Reply to
dagmargoodboat

Pull reset pin low, then you should see minimum consumption

If too high, then your surrounding circuits are the culprit or the device is damaged

Reply to
klaus.kragelund

The best power-saving state for the pins to be on the AVR is configured as outputs, with the outputs driven low. Looks OK in his code, already.

Reply to
bitrex

The DWEN fuse is not enabled >

formatting link

That's the datasheet for the automotive versi > Make sure all the I/O ports are not programmed with > pull-up resistors. Again, you probably need to do it in > AVR codes.

All I/O ports are OUTPUT, LOW.

snipped-for-privacy@yahoo.com says...

I'm unable to find any difference at all. All the I/O ports are set to OUTPUT LOW during the test. That leaves only Vcc, Ground and Reset. The Reset pins have pullup resistors, and they measure 3.3V on both old and new.

One thing I said earlier is wrong. The sleep current is 150uA at 3.3V, but 330uA at 5V, which is not proportional to the voltage difference. If the problem was a simple resistive leak, the current would only be 227uA at 5V. So that still sounds like a processor difference to me. And with the regulator removed, there's very little left on the board to go wrong.

Reply to
Peabody
:

won't you get the added current from the resets 30K-60K internal pullup?

Reply to
Lasse Langwadt Christensen

Grounding the reset pin results in a current of 1.6mA on the new Minis, and 1.1mA on the old one. So that's a 500uA difference. I don't know what that tells me.

Reply to
Peabody

Can you route the clocks to output pins? Then you can check to see if the clocks are running or not.

Your current ratio seems to be proportional to the voltage square which I think you will get from a clock running at a rate proportional to the frequency.

--

  Rick C. 

  + Get 1,000 miles of free Supercharging 
  + Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C

Maybe it tells you... counterfeit?

--

  Rick C. 

  -- Get 1,000 miles of free Supercharging 
  -- Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C

It might. Actually, the new Minis had blobs of white paint over the markings. I thought that might mean the Mini had been tested. But it could also mean "seconds" or "irregulars" from Atmel.

To clarify on the reset current, I changed the meter setup so it only measures the low side current from the Mini to ground, So the current flowing through the pullup resistor directly to ground would not be included. I got 1.15mA for the new Minis, and 0.7mA for the old one. That's still 450uA difference. I don't know what in the surrounding circuitry would account for that.

Reply to
Peabody

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.