Problem with LCSC ATMega328p

This may be well known, but I thought I would post my experience, maybe save someone else some troubles.

I'm working on a small project that requires low power and the atmega328P, running at 3.3v 8Mhz ( actually intend to run it at ~2.8v in the final project as that saves a milli-amp or so.) is a perfect fit.

The first prototype I just used a pro-mini that I bought from SparkFun years ago on a perf-board, Worked great. I built a second unit much the same, only i used a different display. The second unit, i used a cheaper Chinese pro-mini. This worked fine too, however, while the SparkFun unit worked fine at ~2.7 volts, ( tested it down to 2.5 volts! ) the Chinese unit would not function under ~3.3volts. Not a huge deal, but i thought it was strange.

Once I had the design and the code pretty much sorted out, Decided to try EasyEDA to build up a board, instead of KiCad. This was , well, pretty easy, and it was really nice just to pick parts from LCSC for the board. This saved a bunch of time, footprints and BOM are automatically generated, pretty handy.

I got the board all put together, with all the parts I ordered from LCSC, and here is where things turned weird.

I initially programmed the blank 328P with a USBasp programmer, set at 3.3v. The board programmed just fine, but the code would not run. I tried a different USB>TTL converter, and it worked. But when I tried to power the board externally from 3.3V, it would not run the code.

So i checked, and it turned out that the second USB>TTL was actually supplying 5 volts, not the 3.3 i thought it was. So, while the USBasp programmer would program the micro just fine at 3.3v, it simply would not run on 3.3v.

I tried several different things, using another pro-mini as an ISP, loading the pro-mini bootloader, a bread board bootloader ( to use the internal oscillator ) double checking the fuse settings just in case the brown out was set wrong.... etc. Nothing worked, the code simply would not run, nor would it program using the boot loader, if i tried to use 3.3 volts. It would only work if i used 5 volt VCC.

Finally I just decided to de-solder the LCSC 328P that was on the board, and solder on a known good 328P from one of the China pro-mini dev boards. This worked.

So, maybe I just got a bad chip, or maybe LCSC is using knock off clones. LCSCs' price for a single atmega328p is not much different than what digikey is charging, so from now on i will just get them from digikey, hopefully they will be genuine units.

project details...if anyone is wondering why the heck Im trying to use such a low VCC and clock...
The project is a small current sinking tool for testing 4-20mA loops, and its powered by the loop ( no batteries needed ) . I'm using a ILI226 as feedback, and a MCP4725 feeding an opamp circuit to regulate the current in the loop. Using a backlit 128x64 monochrome TFT to display data.
The backlight is the killer.... With only 4mA to work with. But so far, its working better than i had hoped. Using a small buck converter, it functions very well from ~10 to 24+ volt loop voltage, and the output is very stable and noise free, even with the DC/DC converter.

There are a number of clones of the genuine ATmega328xx (which is almost impossible to buy right now). Some are much poorer imitations than others.

Many of them use the LGT8F328P, which is supposedly an improved version of the ATmega328P, but not yet entirely Arduino IDE compatible. You need to download addition files to get it to work.

I've seen no reports from Arduino users regarding the low power operation/sleep characteristics.

Not wondering here at all.

3.3V\8Mhz Pro Minis are the norm these days, as so much of the stuff you connect is 3.3V. Myself its maybe 5 years or more since I used a 5V Arduino.

I actually ordered a few or those for this project, just to see if they would work. The built in DAC and voltage refs would be pretty handy for this.

However, low power they are not.
Can’t remember what currents I measured on those but IIRC they are more in line with the teensy LC, RP2040, XAIO or the smaller SAMD micros. 10-20ma or so.

At 2.5 volts, a “good” 328p is under 2mA IIRC.

On the low power thing though, the last couple of days I’ve been playing around with an STM32L433xxx dev board I bought on tindie.

Its a little bit finicky to set up, but at 16MHz, it draws 0.505 mA running a blink sketch ( LED OFF ) !
Setting it to 24MHz, to enable USB, increases that to 0.780mA .

At full speed, 80MHz, I think it was a little over 2mA !

That’s pretty impressive, I might try to port the code over. If I could keep the current draw of the MCU and the TFT down below 2mA or so, I could ditch the buck converter and use an LDO. Still, the backlight is the killer….. and I need a backlight.

ATmega processors are not "low power", either.

The basic design is around 30 years old, and originated from thesis projects by two engineering students. More recent MCU designs with similar complexity are orders of magnitude more power efficient.

The TI MSP430 series of 16 bit processors are supported by an Arduino-like IDE called Energia, which is worth checking out.

You're asking the wrong folks IMO, If you think a major vendor like LCSC is selling fakes, you want https://microchip.my.site.com/s/ Usually fakes are just dribs and drabs sneaking out a few hundred to one vendor a few hundred to another, etc.

LCSC is china's digikey, so like, if they're selling bunk, it's a big deal, and the nanos you buy in a few months will have the same problem because that's where they got the chips.

Re architectures - yeah core AVR is ollllllld, the 2016 AVRxt instruction timing, and the massive peripheral upgrades we've gotten since then have demonstrated that AVR is alive and kicking, and the fact that they're selling a year ahead of production shows that a modernized AVR, assuming you don't try to make it go toe to toe with 32-bit ARMs can hold it's own. It's also a (relative) joy to write ASM for, which while rarely directly relevant, i think reflects well on the design of the architecture.

Isn't the TI compiler closed source? Closed source compilers are fundamentally unfit for purpose because it is not even possible in principle to verify a compiler free of malice.

There is gcc for MSP430.

Waaaaitaminute.... What are you setting the fuses to?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.