关于 LGT8F328P
芯片参数
- 8位RISC内核
- 32K字节 Flash, 2K字节 SRAM
- 最大支持32MHz工作频率
- 集成32MHz RC振荡器
- 集成32KHz RC振荡器
- SWD片上调试器
- 工作电压: 1.8V ~ 5.5V
- 封装: QFP48, QFP32, QFN32, SSOP20
在 EEVBlog 上有一个相关的讨论 LGT8F328P - clone of ATMega328 with lots of extras!, 里面有 LGT8F328P 和 AT328P 的比较。
LGT8F328P 和 AT328P 的指令周期数对比
LogicGreen公司
生产这个芯片的公司叫 LogicGreen, www.lgtic.com, 主营是LGT8开头的一系列MCU, 面向中低端市场, 非常低调(这公司甚至连中文名都没有, 没有见过任何广告, 出名完全是因为 LGT8F328P 兼容 ATmega328P, 可以平替火热的 Arduino 系列开发板。
http://www.lgtic.com/lgt8fx8p/, 在上面有数据和用户手册。
关于开发板
正面
背面
- 丝印上的DIR应该是写错了, 实际上是 DTR
- 板子上LDO是 5V 的 AMS1117, VCC和5V都是5V, 而 VIN 这个脚对应的是 AMS1117 的输入脚, 输入需要大于 6V. 接线时要注意区分.
- 板子上不带 USB2TTL, 开发时需要自备 CH340, CP2102 这类 USB2TTL 的USB转换头
接线
LGT8F328P -> CH340, CP2102
VCC -> 3.3V
GND -> GND
TX -> RX
RX -> TX
DTR -> DTR
Arduino 环境和 LGT8F328P 支持包 lgt8fx
安装 Arduino IDE 2.x 和 lgt8fx 的过程请点击这里查看 https://www.cnblogs.com/milton/p/17063445.html
- Board: LGT8F328P
- Port: 根据自己本地的串口选择
- Clock: 32MHz
- Clock Source: Internal
- Variant: 328P-LQFP32 (e.g. MiniEVB, nano-style or WAVGAD
之后就可以直接编译烧录 Blink 示例
遇到的问题 无法自动烧录
对比了下标准的 Arduino Nano 和 CH340 的电路 Arduino Nano ATmega238P/CH340G V3.0 PCB Layout, DTR脚和RST脚之间也是104的电容。
LGT8F328P EDMINI board. 他也遇到了同样的问题, DTR Reset doesn't work
A negative pulse on DTR will cause a voltage drop on RST, which is supposed to reset the target. When the target power is 5V and 3V3 TTL signals are used, toggling DTR will cause RST to drop from 5V to about 1.7V (5 - 3.3. With the ATmega328P and most other AVR MCUs, 2V is low enough to reset the chip. The LGT8F328P, however requires a lower voltage to reset. In some situations this can be a good thing, as it means the LGT MCU is less likely to reset due to electromagnetic interference。
解决的办法也很简单, 就是把供电换成 3.3V, 之后每次烧录都会稳稳地重启了。
用于烧录 LGT8F328P 的 LGTISP
相对于官方的 ISP 硬件, brother_yan 提供了一种使用 LGT8F328P 制作 ISP 工具的方案