Lgt8fx
Board Package for Logic Green LGT8F328P LGT8F328D and LGT8F88D
Install / Use
/learn @dbuezas/Lgt8fxREADME
How to install
Add the package to the arduino Boards Manager Urls:
- Go to Preferences
- paste this url in Boards Manager URL:
https://raw.githubusercontent.com/dbuezas/lgt8fx/master/package_lgt8fx_index.json
- paste this url in Boards Manager URL:
- Go to Tools/Board/Boards manager
- Type
lgt8fxin the search box - install lgt8fx
- Type
Now the boards appear in the IDE. You can also select clock speeds, upload speeds and generic boards with external cystal.
<img src="./docs/arduino/boards_manager.png" alt="Boards Manager" width="550"> <img src="./docs/arduino/variants.png" alt="Variants" width="550"> <img src="./docs/arduino/clock.png" alt="Clock" width="550"> <img src="./docs/arduino/clock-source.png" alt="External Clock" width="550">32Mhz is twice as fast as a conventional arduino nano! Actually even faster as many operations take less clock cycles than in the atmega328p. Check out some benchmarks
Recommended read
Tutorials and details about this board: LGT8F328P - LQFP32 Boards • Wolles Elektronikkiste
Discussions, ideas, questions and show your project
- Explore the discussions: https://github.com/dbuezas/lgt8fx/discussions
Features
- [x] Fast_IO update
- [x] In-menu external clock support (by #seisfeld)
- [x] In menu generic boards support with 1, 2, 4, 8, 12, 16 and 32 Mhz
- [x] Automatic prescaler setup
- [x] Digital Analog Converter
- [x] Voltage References INTERNAL1V024/INTERNAL2V048/INTERNAL4V096/DEFAULT/EXTERNAL (useful for example for analogRead or DAC analogWrite via analogReference(xxx));
- [ ] Analog Comparator (page 224 of datasheet v1.0.4)
- [x] Differential Amplifier. See this Example.
- [ ] Computation Accelerator (page 52 of datasheet v1.0.4) Work by others
- [x] SoftwareSerial at any clock speed. Updated implementation without timing tables by #jg1uaa
- [x] 2 to 6 high current 80ma IO pins (thanks #rokweom)
- [x] 328p Arduino ISP (from #brother-yan)
- [x] SSOP20 328p Support (by #LaZsolt)
- [x] Accurate delayMicroseconds (by #LaZsolt)
- [x] Faster Analog Read (by #jayzakk)
- [x] Fixed analogReference (reported by #macron0)
- [x] Enabled AREF pin as A10 analog input (by #jayzakk)
- [x] Power reduce register definitions (by #KooLru)
- [x] Support for interrupts on all timers and comparators (by #jayzakk)
- [x] Arduino EEPROM API (by #SuperUserNameMan
- [ ] Lock bits. It seems this micro controller doesn't have flash lock bits.
Timers
This chip has more timers, each with more features than the atmega328p. Explore, configure and visualize timers for both atmega328p and lgt328p with this online tool https://github.com/dbuezas/arduino-web-timers <img width="800" alt="image" src="https://user-images.githubusercontent.com/777196/221049698-d2a51443-73c8-42d7-8e85-b46f25c42dc7.png">
Differences to original core Larduino_HSP v3.6c
- Support 32 Mhz and other clock speeds
- Selectable ADC resolution (Arduino compatibile default is 10 bits)
- Differential Amplifier API
- Better Boards Menu
- Installation via Board Manager Urls
- SoftwareSerial @32Mhz
- FastIO ported from https://github.com/LGTMCU/Larduino_HSP
Power consumption @ 5v
| Clock | Pro mini style w/o power LED | Pro mini style | Nano style | | ----- | ---------------------------- | -------------- | ---------- | | 32MHz | 12.7mA | 15.0mA | 32.6mA | | 16MHz | 9.2mA | 11.5mA | 27.8mA | | 8MHz | 7.1mA | 9.4mA | 25.4mA | | 4MHz | 5.9mA | 8.2mA | 23.3mA | | 2MHz | 5.3mA | 7.6mA | 23.4mA | | 1MHz | 5.0mA | 7.3mA | 22.8mA |
Example boards:
-->LGT8F328P-SSOP20
Pro Mini Style SSOP20
<img src="./docs/boards/ssop20.jpg" alt="Pro Mini ssop20" width="200"> <img src="./docs/boards/ssop20_back.jpg" alt="Pro Mini ssop20" width="200"> <img src="./docs/boards/ssop20.png" alt="Pro Mini ssop20" width="200">
<img src="./docs/boards/lgt8f328p_pro_mini_ssop20_pinout.png" alt="Nano style" width="800"> Pinout by [wollewald](https://github.com/wollewald)-->LGT8F328P-LQFP32
WAVGAT Pro Mini Pseudo Clone
<img src="./docs/boards/WAVGAT_Pro_Mini_Clone.jpg" alt="Wavgat Pro Mini pseudo-clone" width="200"> <img src="./docs/boards/wavgat_back.jpg" alt="Wavgat Pro Mini pseudo-clone" width="200"> Chip marked as AVGA328P
Pro Mini style
<img src="./docs/boards/pro_mini_LQFP32.png" alt="Pro Mini style" width="200"> <img src="./docs/boards/lgt8f328p_pro_mini_qfp32l_pinout.png" alt="Nano style" width="800">Pinout by wollewald Visit his Electronic projects blog here https://wolles-elektronikkiste.de/en/
Nano Style
<img src="./docs/boards/nano.jpg" alt="Nano style" width="200"> <img src="./docs/boards/nano_back.jpg" alt="Nano style" width="200">
<img src="./docs/boards/nano_LQFP32.png" alt="Nano style" width="200"> <img src="./docs/boards/lgt8f328p_nano_qfp32l_pinout.png" alt="Nano style" width="800">Pinout by wollewald
Like this pinout?
Create more pinouts for the other boards!
Wemos TTGO XI
<img src="./docs/boards/wemos.jpg" alt="Wemos Nano style" width="200"> <img src="./docs/boards/wemos back.jpg" alt="Wemos Nano style" width="200">
<img src="./docs/boards/TTGO_XI_8F328P-U_nano_V3.0_LQFP32.png" alt="Wemos Nano style" width="200">Uno Style
<img src="./docs/boards/uno_LQFP32.jpeg" alt="Uno style" width="200">-->LGT8F328D-LQFP32
LARDUINO Uno style
<img src="./docs/boards/larduino_uno-front.jpg" alt="Larduino Uno style" width="200"> <img src="./docs/boards/larduino_uno-back.jpg" alt="Larduino Uno style" width="210">
-->LGT8F328P-LQFP48
Nano Style
<img src="https://user-images.githubusercontent.com/777196/232343332-d8d93c6b-80b1-4865-9910-bfa864a91081.png" alt="Nano style" width="200"> <img src="./docs/boards/lgt8f328p_nano_qfp48l_pinout.png" alt="Nano style" width="800"> Pinout by [wollewald](https://github.com/wollewald)Uno Style
<img src="./docs/boards/uno_LQFP48.png" alt="Uno style" width="200">Docs & links
- Check the Wiki for more content by contribuitors
- And you may also find something in the closed Issues
- Core is based on Larduino_HSP v3.6c with fastIO backported from https://github.com/LGTMCU/Larduino_HSP
- And inspired from Ralph Bacon's video: https://youtu.be/Myfeqrl3QP0 (Check his channel, he's uploaded a lot of great videos)
- Great place to gather data about this boards: https://github.com/RalphBacon/LGT8F328P-Arduino-Clone-Chip-ATMega328P
- Datasheet (Chinese) LGT8FX8P_databook_V1.04
- Datasheet (English) LGT8FX8P_databook_V1.04 thanks to #metallurge
- Datasheet (English) LGT8FX8P_databook_V1.05 By Watterrott
- Instruction set clk vs avr By unknown, claim if you are the author
- Work on the differential amplifier
- "Forbiden tech from China has arrived" https://www.avrfreaks.net/forum/forbiden-tech-china-has-arrived?page=all
- Larduino ISP for 328d https://github.com/Edragon/LGT/tree/master/Toolchain/LarduinoISP-master
- https://www.eevblog.com/forum/projects/anyone-here-interested-in-the-logic-green-avrs-lgt8f328p/
- http://coultersmithing.com/forums/viewtopic.php?f=6&t=1149
- LGT SDK Builder
- "very useful during development, hopefully others can find it helpful too." @sengit
- Document page : http://www
