super_star

LGTISP--LGT microcontroller downloader

 
Overview

top.jpg

bottom.jpg

This project is a programmer for LGT8Fx8P/D, used to burn firmware ( .hex/ .bin) into the LGT8Fx8P/D chip

Introduction

  • Hardware supports burning LGT8Fx8P/D chip
  • The microcontroller is equipped with a bootloader, which can easily upgrade the firmware of this programmer. You can use my firmware (only supports LGT8Fx8P, supports reading flash when the power is not cut off), or the official firmware, or even the firmware written by yourself.
  • Pin definitions are compatible with the latest official emulator (SWDICE mkII v2.0)
  • Except for the LED lights, USB plugs, and programming sockets that display status, all components are placed on the bottom layer, and there are detailed silk screen instructions on the top layer. beautiful
  • There are three status indicators for power (POWER), operation (RUN), and error (ERROR) to facilitate observation of the burning process.
  • Compatible with AVR ISP download protocol, the host computer can use it as AVR ISP
  • Flash content can be read without power interruption (the official programmer does not have this function!)
  • Can read the unique ID of the chip (the official programmer does not have this function!)
  • Heavy! ! ! The myth that lgt microcontroller cannot read flash has been solved! ! ! Currently, all flash except the first 1k can be read, but the first 1k flash will be erased (the official programmer does not have this function!)
  • My firmware supports mega328p. Burn my firmware into Arduino Nano and other boards, and it can be used as well.
  • My firmware is open source on github !
  • low cost

Circuit description

schematic.png This programmer is based on Arduino design. This programmer adopts the solution of USB to serial port + lgt8f328p microcontroller. The USB to serial port chip can use CH340C. It is recommended to use CH340G+12MHz crystal oscillator to make the baud rate more accurate. The DTR of CH340 is connected to the RESET pin through a 0.1uF capacitor, which is compatible with the Arduino download method. The lgt8f328p microcontroller uses an external 16MHz crystal oscillator to avoid the problem of excessive baud rate errors caused by excessive errors in the internal RC oscillator. The pull-up resistors of SWC and SWD can be soldered, and it is recommended to solder a 10k resistor.

Update part of the circuit description

When the host computer opens the serial port, the DTR pin sometimes changes in level, which causes the microcontroller to reset. During normal use, you do not want the microcontroller to reset and enter the bootloader. RESET should be forced to VCC. When upgrading the firmware, you need to use RESET to enter the bootloader to complete the firmware upgrade. At this time, you need to release the forced pull-up of RESET. In order to be compatible with the official upgrade logic: the #UPDATE pin is connected to GND to upgrade the firmware. When the #UPDATE pin is left floating, it can be used normally and cannot upgrade the firmware. A circuit consisting of Q1, Q2, R2, and R3 is designed. When #UPDATE is floating, Q1 is turned on, and the G electrode voltage of Q2 is 0, so Q2 is also turned on, which means RESET is forced to pull to VCC; when #UPDATE is connected to GND, Q1 is turned off, and the G electrode voltage of Q2 is VCC. Therefore, Q2 is also cut off and RESET is no longer forced to be pulled up.

Files required to make PCB

LGTISP gerber files

Burn firmware

Burn bootloader

  1. First of all, you need to have something that can burn firmware for lgt8f328p, such as an official emulator, or use the open source LarduinoISP , LGTISP , LarduinoISP_SHIELD
  2. The SWC and SWD pads on the back are used to burn firmware for lgt8f328p and connect them to the programmer.
  3. Don’t forget to power this programmer
  4. The bootloader is here: optiboot_lgt8f328p.hex . This is the bootloader I modified, mainly using an external 16MHz crystal oscillator.

Upgrade firmware

  1. UPDATE and GND shorted

  2. Now this programmer is a Larduino development board. I won’t go into details on how to program it.
  3. You can also use my batch process烧写LGTISP固件.bat
  4. Remove jumper from #UPDATE to GND

How to use this programmer (taking the Arduino environment as an example)

  1. Install Larduino
  2. Development board selection LGT8Fx8P
  3. Programmer selects AVR ISP
  4. Now you can burn the bootloader and upload using the programmer

Advanced usage

  • Send z( 0x7a 0x20) through the serial port to return the GUID (for example: 0x14 0xa5 0xc4 0x18 0x33 0x20)
  • Send y( 0x79 0x20) through the serial port to return copyright information
  • This programmer is essentially a Larduino development board. As long as #UPDATE and GND are short-circuited, you can use it as a Larduino development board; remove the jumper between #UPDATE and GND and you can directly run the user program without entering the bootloader.

Develop more interesting uses yourself!

author

brother_yan

Old version project description

lgt8f328p is a domestically compatible version of mega328p, but it is not compatible with the mega328p programmer. Therefore, you need to buy an expensive official downloader, or make one yourself, such as https://oshwhub.com/larduino/lgt_mini_box or https://oshwhub.com/larduino/larduino_isp_shield . The former requires you to have a Xintang downloader, and the latter requires you to have certain hands-on skills. I have seen the author of shield board guide novices, and it made me very anxious. . . So I made this LGTISP downloader, aiming to reduce the complexity of production, and having a dedicated downloader is much more convenient than using it temporarily. Since I have analyzed the timing of the official downloader ( https://github.com/brother-yan/LGTISP ), I think my firmware is better to use, but in order to allow users to easily switch between my firmware and the official firmware, I designed the update function. The pin definitions of my downloader are exactly the same as the pin definitions of the latest official downloader, and I try my best to ensure compatibility. The production BOM cost should be less than 10 yuan.

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-20 20:44:25

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号