lgt8fx icon indicating copy to clipboard operation
lgt8fx copied to clipboard

Suppoort board with 16MHz crystal

Open andrey-belokon opened this issue 2 years ago • 6 comments

Hi, I buy on ali boards with 16MHz crystal. In arduino IDE I can select only 32MHz as external clock. Please add support for 16MHz external clock. Thanks, Andrey

andrey-belokon avatar Apr 21 '22 16:04 andrey-belokon

Maybe this will works with 16 or 12 MHz. https://github.com/dbuezas/lgt8fx/blob/fb4f06a097e6a225a20d1b78d7e70eac160a6d5b/lgt8f/boards.txt if you replace your own copy.

Here are some pictures of how the menu will look like: https://github.com/dbuezas/lgt8fx/pull/119#issuecomment-1006800753

LaZsolt avatar Apr 22 '22 13:04 LaZsolt

I try to replace boards.txt, but simple blink.ino compiled with error

c:\program files (x86)\arduino\hardware\tools\avr\avr\include\util\delay.h: In function 'void _delay_ms(double)': <command-line>:0:8: error: 'build' was not declared in this scope In file included from C:\Users\Andre\AppData\Local\Arduino15\packages\LGT8fx Boards\hardware\avr\1.0.6\cores\lgt8f/USBAPI.h:27:0, from C:\Users\Andre\AppData\Local\Arduino15\packages\LGT8fx Boards\hardware\avr\1.0.6\cores\lgt8f/Arduino.h:243, from sketch\LGT8F328P_16mhz.ino.cpp:1: c:\program files (x86)\arduino\hardware\tools\avr\avr\include\util\delay.h:174:19: error: invalid operands of types 'void' and 'double' to binary 'operator/' __tmp = ((F_CPU) / 1e3) * __ms; ~~~~~~~~^~~~~ c:\program files (x86)\arduino\hardware\tools\avr\avr\include\util\delay.h: In function 'void _delay_us(double)': <command-line>:0:8: error: 'build' was not declared in this scope In file included from C:\Users\Andre\AppData\Local\Arduino15\packages\LGT8fx Boards\hardware\avr\1.0.6\cores\lgt8f/USBAPI.h:27:0, from C:\Users\Andre\AppData\Local\Arduino15\packages\LGT8fx Boards\hardware\avr\1.0.6\cores\lgt8f/Arduino.h:243, from sketch\LGT8F328P_16mhz.ino.cpp:1: c:\program files (x86)\arduino\hardware\tools\avr\avr\include\util\delay.h:263:19: error: invalid operands of types 'void' and 'double' to binary 'operator/' __tmp = ((F_CPU) / 1e6) * __us; ~~~~~~~~^~~~~ exit status 1

andrey-belokon avatar Apr 28 '22 18:04 andrey-belokon

Last time I did not write the good location of boards.txt C:\Users\ (Your username) \AppData\Local\Arduino15\packages\LGT8fx Boards\hardware\avr\1.0.6\

If you have placed boards.txt this locacion C:\Program Files (x86)\Arduino\hardware\arduino\avr\, then you need to retrieve the original file here.

LaZsolt avatar Apr 28 '22 21:04 LaZsolt

I have the same problem but with arduino under linux, where I put the modified board.txt file?

tistructor avatar Jun 08 '22 14:06 tistructor

I don't have Linux, but I think you can find the location: kép Open the FIle / Preferences menu in Arduino IDE, then you will see what is the location of the custom board packages, Much like what's in the picture in the red box. Then attach packages/LGT8fx Boards/hardware/avr/1.0.6/ to that location. I think this is where you will found the board.txt.

Anyway, you might want to try the pre release of lgt8fx package: https://github.com/dbuezas/lgt8fx/discussions/207 This pre release includes several types of fixes, not just this clock selection menus. If you tried the pre release, please indicate if it worked well.

LaZsolt avatar Jun 08 '22 15:06 LaZsolt

The alpha 1.0.7 version works well and the timing is also correct with the baudrate of the serial port.

Version 1.0.6 instead causes the compilation error. Con la versione modificata boards.txt

tistructor avatar Jun 08 '22 20:06 tistructor

Can you verify that the release 1.0.7 corrects this issue as well and close this issue if so? Thank you.

dwillmore avatar Jan 12 '23 18:01 dwillmore

Support board with 16MHz crystal

With release v2.0.0. the support is done.

Can you verify that the release 1.0.7 corrects this issue as well

@tistructor verified.

So I close this issue.

LaZsolt avatar Jan 31 '23 12:01 LaZsolt