MCUdude / MightyCore

Arduino hardware package for ATmega1284, ATmega644, ATmega324, ATmega324PB, ATmega164, ATmega32, ATmega16 and ATmega8535
Other
651 stars 183 forks source link

Adding Profiles for 20 and 16 Mhz External clock (not crystal) - atmega32 #288

Closed lindoran closed 10 months ago

lindoran commented 11 months ago

Good afternoon,

I was wondering if you would be interested in a pull request to add/change the following to boards.txt for the atmega32/a?

32.menu.clock.16MHz_external=External 16 MHz (crystal) 32.menu.clock.16MHz_external.upload.speed=115200 32.menu.clock.16MHz_external.bootloader.sut_cksel_bits=111111 32.menu.clock.16MHz_external.bootloader.ckopt_bit=0 32.menu.clock.16MHz_external.build.f_cpu=16000000L

32.menu.clock.16MHz_clock=External 16 MHz (clock) 32.menu.clock.16MHz_16clock.upload.speed=115200 32.menu.clock.16MHz_16clock.bootloader.sut_cksel_bits=000000 32.menu.clock.16MHz_16clock.bootloader.ckopt_bit=1 32.menu.clock.16MHz_16clock.build.f_cpu=16000000L

32.menu.clock.20MHz_external=External 20 MHz (crystal) 32.menu.clock.20MHz_external.upload.speed=115200 32.menu.clock.20MHz_external.bootloader.sut_cksel_bits=111111 32.menu.clock.20MHz_external.bootloader.ckopt_bit=0 32.menu.clock.20MHz_external.build.f_cpu=20000000L

32.menu.clock.16MHz_20clock=External 20 MHz (clock) 32.menu.clock.16MHz_20clock.upload.speed=115200 32.menu.clock.16MHz_20clock.bootloader.sut_cksel_bits=000000 32.menu.clock.16MHz_20clock.bootloader.ckopt_bit=1 32.menu.clock.16MHz_20clock.build.f_cpu=20000000L

This would add sourcing a clock on a single pin in situations where the clock is coming from a discrete oscillator, I don't know if it could be further added to the drop downs in a way that offers this to the other chips as well. This was just a quick and dirty to get what I needed, and I only looked into just the atmega32.

also attached here if you are interested in just manually dropping the change

boards.txt

lindoran commented 10 months ago

after trying with the default clock settings -- this seams to work in any case ~ these changes aren't needed