Author Topic: LGT8F328P - clone of ATMega328 with lots of extras!  (Read 16009 times)

0 Members and 2 Guests are viewing this topic.

Online FungusTopic starter

  • Super Contributor
  • ***
  • Posts: 16967
  • Country: 00
Re: LGT8F328P - clone of ATMega328 with lots of extras!
« Reply #25 on: July 29, 2022, 08:26:07 am »
This doc lists the advantages:


« Last Edit: July 29, 2022, 08:36:18 am by Fungus »
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6159
  • Country: es
Re: LGT8F328P - clone of ATMega328 with lots of extras!
« Reply #26 on: July 29, 2022, 03:20:29 pm »
Given the descriptions, more chinese, definitely! :D
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline AndyBeez

  • Frequent Contributor
  • **
  • Posts: 856
  • Country: nu
Re: LGT8F328P - clone of ATMega328 with lots of extras!
« Reply #27 on: July 29, 2022, 04:43:57 pm »
Barely known outside of China, these 'LG' ( LogicGreen ) chips exist mainly for deployment in dirt cheap Chinese consumer products: toys to appliances and to more toys. Don't expect the reliability or support of the original Atmel products. So avoid using in your self driving car project. Since chipaggedon started, these are being sold in arduino clone boards at arduino 'compatible' prices. If you want extras with documentation, play with STM32s.
 

Online FungusTopic starter

  • Super Contributor
  • ***
  • Posts: 16967
  • Country: 00
Re: LGT8F328P - clone of ATMega328 with lots of extras!
« Reply #28 on: July 29, 2022, 08:31:24 pm »
Barely known outside of China, these 'LG' ( LogicGreen ) chips exist mainly for deployment in dirt cheap Chinese consumer products: toys to appliances and to more toys.

Is that bad thing?

Who doesn't want a cheaper Arduino-compatible chip with extra timers, extra PWMs and a DAC for hobby use?
 

Online FungusTopic starter

  • Super Contributor
  • ***
  • Posts: 16967
  • Country: 00
Re: LGT8F328P - clone of ATMega328 with lots of extras!
« Reply #29 on: July 30, 2022, 02:12:19 am »
I created a DeepL account to re-translate the datasheet. It seems nicer in some areas, especially the diagrams.

Copy attached below.

Now let's see if I can really cancel the "subscription" before they charge me anything.  :popcorn:
« Last Edit: July 30, 2022, 02:17:54 am by Fungus »
 
The following users thanked this post: elecdonia, ADI8421

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6159
  • Country: es
Re: LGT8F328P - clone of ATMega328 with lots of extras!
« Reply #30 on: July 30, 2022, 02:49:35 am »
Remember you can do the same thing using Google translate, for free.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Online FungusTopic starter

  • Super Contributor
  • ***
  • Posts: 16967
  • Country: 00
Re: LGT8F328P - clone of ATMega328 with lots of extras!
« Reply #31 on: July 30, 2022, 06:29:50 am »
Remember you can do the same thing using Google translate, for free.

Like in this post?  :)

https://www.eevblog.com/forum/microcontrollers/lgt8f328p-clone-of-atmega328-with-lots-of-extras-anybody-use-them/msg4248262/#msg4248262

I was just wondering if it would be any better.
 

Offline agarza

  • Newbie
  • Posts: 2
  • Country: mx
Re: LGT8F328P - clone of ATMega328 with lots of extras!
« Reply #32 on: September 21, 2022, 03:00:46 am »

[/quote]

That seems very high. What's your sleep code?
[/quote]

This is the code I use to sleep.  On a ATMEGA328p the current is ~1µA.  On a LGT8F328P ~150µA. 
set_sleep_mode(SLEEP_MODE_PWR_SAVE);
TCCR2B = (1 << CS20) | (1 << CS22);

 // Wait until TC2 is updated
 while ((ASSR & ((1 << OCR2AUB) | (1 << OCR2BUB) | (1 << TCR2AUB) | (1 << TCR2BUB) | (1<< TCN2UB))));

 sleep_mode();    //sleep!


There are many other Power registers on the LGT8F328P.  I've tried several with no luck.
 
The following users thanked this post: elecdonia

Offline elecdonia

  • Frequent Contributor
  • **
  • Posts: 399
  • Country: us
Re: LGT8F328P - clone of ATMega328 with lots of extras!
« Reply #33 on: December 29, 2022, 03:46:51 pm »
Given the rocketing price of AVR Aduinos, I've just been looking at these things...

https://www.aliexpress.com/wholesale?SearchText=LGT8F328P

The extra features are very interesting for a project I have in mind, both for the DAC and for the extra ALU.

I ordered a few (some purple, some green) and so far so good. They work just like Arduino in the Arduino IDE.
Regarding clone Arduino Nano boards with LGT8F328P MCU:

1) Green LGT8F328P Nano boards are the cheapest. They use the internal RC clock of the MCU.

I wonder how stable (or unstable) the internal RC clock frequency is in these new ultra-cheap MCU chips?
My experience with the “calibrated” internal RC oscillator in genuine Atmel AVR chips is that it is sufficiently stable enough for applications which don’t require precise timing.
A big advantage of internal RC clock is that MCU starts up much faster compared to using crystal oscillator. This is important for applications which must wake up quickly from a deep sleep state where the clock is shut down.

2) Purple LGT8F328P Nano boards have an actual 32MHz crystal for the oscillator. This is similar to nearly all other Nano boards which have a genuine ATmega328 MCU, except the clock crystal for the purple LGT8F328P is 32MHz rather than the 16 or 8MHz crystal found in ATmega328 Nano boards.

3) After using many clone Nano and Arduino-pro boards that came with a genuine Atmel ATmega328 MCU, I must warn users that the Arduino clone board manufacturers use the very cheapest LDR voltage regulator chips. Many of these can tolerate only 9V maximum input voltage. I fried several clone Nano boards by applying 12V. I developed a habit of changing the voltage regulator chips for applications where the raw power input voltage might exceed 9V.

« Last Edit: December 30, 2022, 06:34:24 pm by elecdonia »
I’m learning to be a leading-edge designer of trailing-edge technology.
 

Online FungusTopic starter

  • Super Contributor
  • ***
  • Posts: 16967
  • Country: 00
Re: LGT8F328P - clone of ATMega328 with lots of extras!
« Reply #34 on: December 30, 2022, 07:42:48 am »
I wonder how stable (or unstable) the internal RC clock frequency is in these new ultra-cheap MCU chips?

The datasheet say's they're laser-trimmed at the factory. The frequency seems very accurate on the few chips I've measured.

2) Purple LGT8F328P Nano boards have an actual 32MHz crystal for the oscillator. This is similar to nearly all other Nano boards which have a genuine ATmega328 MCU, except the clock crystal for the purple LGT8F328P is 32MHz rather than the 16 or 8MHz crystal found in ATmega328 Nano boards.

Yep. I'm not sure what the advantage of the crystal is.

The main advantage of the purple ones is the built-in CH340 USB interface.

(although that's a bad thing for low-power projects).

I've gone through a few dozen of the green ones lately and not had any problems.
 
The following users thanked this post: elecdonia

Offline elecdonia

  • Frequent Contributor
  • **
  • Posts: 399
  • Country: us
Re: LGT8F328P - clone of ATMega328 with lots of extras!
« Reply #35 on: December 30, 2022, 06:45:24 pm »
I wonder how stable (or unstable) the internal RC clock frequency is in these new ultra-cheap MCU chips?
The datasheet say's they're laser-trimmed at the factory. The frequency seems very accurate on the few chips I've measured.
2) Purple LGT8F328P Nano boards have an actual 32MHz crystal for the oscillator. This is similar to nearly all other Nano boards which have a genuine ATmega328 MCU, except the clock crystal for the purple LGT8F328P is 32MHz rather than the 16 or 8MHz crystal found in ATmega328 Nano boards.
Yep. I'm not sure what the advantage of the crystal is.
The main advantage of the purple ones is the built-in CH340 USB interface. (although that's a bad thing for low-power projects).

I've gone through a few dozen of the green ones lately and not had any problems.
Thanks for the info!

Revised features of green vs. purple LGT8F328P Arduino clones:
     Green board resembles traditional Arduino Pro:  Very small PC board without USB. MCU clock is internal factory-trimmed clock oscillator
     Purple board resembles Arduino Nano: USB interface included. MCU clock is crystal on PC board
I’m learning to be a leading-edge designer of trailing-edge technology.
 

Offline ADI8421

  • Newbie
  • Posts: 5
  • Country: nz
Re: LGT8F328P - clone of ATMega328 with lots of extras!
« Reply #36 on: January 11, 2023, 06:34:04 am »
Hi Fungus,

I've taken an interest in writing code for these in assembly language too.
A brief video of my DAC test here:

Cheers Jim
 

Online FungusTopic starter

  • Super Contributor
  • ***
  • Posts: 16967
  • Country: 00
Re: LGT8F328P - clone of ATMega328 with lots of extras!
« Reply #37 on: January 11, 2023, 02:24:58 pm »
Hi Fungus,

I've taken an interest in writing code for these in assembly language too.

 :)  :-+

A brief video of my DAC test here:

The DAC works great at audio frequencies.
 

Offline ADI8421

  • Newbie
  • Posts: 5
  • Country: nz
Re: LGT8F328P - clone of ATMega328 with lots of extras!
« Reply #38 on: January 13, 2023, 04:34:23 am »
Yes, the audio is pretty good. The data sheet advises an opamp buffer should be used on the DAC output, but it works OK into a Tecsun radio's Aux input without one.
 

Online FungusTopic starter

  • Super Contributor
  • ***
  • Posts: 16967
  • Country: 00
Re: LGT8F328P - clone of ATMega328 with lots of extras!
« Reply #39 on: January 13, 2023, 06:28:51 am »
Yes, the audio is pretty good. The data sheet advises an opamp buffer should be used on the DAC output, but it works OK into a Tecsun radio's Aux input without one.

No surprise, an aux input will be high impedance just like an op-amp.
« Last Edit: January 13, 2023, 05:50:54 pm by Fungus »
 

Offline yurishnol

  • Newbie
  • Posts: 1
  • Country: il
Re: LGT8F328P - clone of ATMega328 with lots of extras!
« Reply #40 on: March 01, 2023, 02:11:25 pm »
Hi, this is about measure of VCC.
The bug (?) in board support lib package - currently Larduino_HSP_v3.6c still has it.
To measure VCC, one can use internal mux channel to internal VRef=1.024V (default),
by A/D reference=VCC, default.  analogReference(DEFAULT);
uint16_t AtoD = analogRead(IVREF); // IVREF=27 for lgt8f
Then, calculate VCC=(1.024/AtoD)*4096; //Volt.
 or else, VCC=4194304/AtoD,mV. (0x400000/AtoD)
For original AVR' 328p, instead of 4096 use 1024, for AtoD is 10 bit.
Currently, for lgt8f the code do not work, analogRead(IVREF) returns 0..2.
To fix the problem, need set the bit BGEN, bit7 in register ADCSRD,
 ADC Control Status Register D.
e.g.: ADCSRD = 0x80;
Then, AtoD of IVREF: uint16_t AtoD = analogRead(IVREF);
 will return correct value. e.g.:
for VCC=3.36 V, analogRead(IVREF) returns 1249. VCC=1.024/1249*4096=3.358V
for VCC=4.72 V, analogRead(IVREF) returns 889.  VCC=1.024/889*4096=4.718V
 
The following users thanked this post: Fungus

Offline Gjeskog

  • Newbie
  • Posts: 1
  • Country: no
Re: LGT8F328P - clone of ATMega328 with lots of extras!
« Reply #41 on: March 11, 2023, 04:00:49 am »
Hi all. I'm one of those idiots taking an interest in these LogicGreen microcontrollers, so I ordered a bunch a while back. And out of frustration with not having a proper manual to learn from, I set out to translate the manual for this chip. I have used Google, but in small chunks to be able to properly recreate context and readabillity.

Personally I'm pretty pleased with the result, allthough it's not yet properly proofread, but I'm thinking this might be of some interest for others with simmilar interest in cheap Chinese MCUs.

https://github.com/Skogmus/Datasheet_translations/tree/main/LGT8FX8P_databook_v1.0.5

Have a look at it, and feel free to pitch in corrections if you feel like it.
 
The following users thanked this post: PeterG, paf, Fungus, elecdonia, GromBeestje, IOsetting

Online FungusTopic starter

  • Super Contributor
  • ***
  • Posts: 16967
  • Country: 00
Re: LGT8F328P - clone of ATMega328 with lots of extras!
« Reply #42 on: March 11, 2023, 05:50:01 pm »
Hi all. I'm one of those idiots taking an interest in these LogicGreen microcontrollers, so I ordered a bunch a while back. And out of frustration with not having a proper manual to learn from, I set out to translate the manual for this chip. I have used Google, but in small chunks to be able to properly recreate context and readabillity.

That's awesome, especially the diagrams and tables. The machine translators really made a mess of the diagrams/tables when I tried them.

 :-+ :-+ :-+ :-+ :-+
 
The following users thanked this post: Gjeskog

Online FungusTopic starter

  • Super Contributor
  • ***
  • Posts: 16967
  • Country: 00
Re: LGT8F328P - clone of ATMega328 with lots of extras!
« Reply #43 on: March 11, 2023, 05:52:37 pm »
FWIW I've used a lot of these lately. I'm pretty much doing all my gadgets using them and haven't had any problems.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf