LGTMCU / Larduino_HSP

Hardware support package for Larduino
MIT License
138 stars 68 forks source link

LGT8F328D - SSOP20 / can not load sketch with Optiboot bootloader #10

Open haindvn opened 4 years ago

haindvn commented 4 years ago

I have some bare chip LGT8F328D (not P) and I successfully loaded the Optiboot bootloader into these chips with LGT SWDICE (I plugged a LED to pin PB5 and it flashes in triple then stop then flashes again, same as LGT8F328P). I have tried the following Optiboot

optiboot_lgt8f328d_intosc.hex optiboot_lgt8f328d.hex optiboot_lgt8f88ds20.hex

However, when connect the bare chip via USB TTL CP2102 but I can not load any sketch with Arduino IDE, avrdude reports the following error

         Using Port                    : COM5
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x19

With "resp=0xXX" change everytime I tried to reload. I also tried to reset the chip manually by providing a reset button to GROUND line for reset (the chip is actually reset as it stops flashing), but it doesn't work.

I noted that only this bootloader make the LED @ PB5 flashed: optiboot_lgt8f328d_intosc.hex, the others don't. Is this compiled correctly since I tried to read the source codes and found that it includes lgtx8e.h / not lgtx8p.h.

I tried the chip LGT8F328P with optiboot_lgt8f328p.hex and it works like a charm without any problem, I tried with ~ 5 chips LGT8F328P and 3 chips LGT8F328D and experience the same problems, all the P chips work like a charm.

Have anyone successfully done with LGT8F328D?