I am encountering clocking problems using megaTinyCore with IDE 2.
Some details.
I use an ATTiny1614 to generate DCC signals using timer TCA. With prescaler set to 1 clocking is at system clock and timer values are for 16MHz clock speed (historical mostly).
I built a new H-Bridge driver and was checking the pulse rise times and then decided to check the period. Pulses representing a 1 should be 116 micro second and zero should be 200. I measured 92.7, for a one, implying clocking at 20MHz. Checking my settings in megaTinyCore it was definitely set to 16MHz.
I then did some experimenting. It turns out that the clock is not set to 16MHz for any of the frequencies requiring it. All setting are only using the 20MHz setting.
Looking at the upload it actually always displays:
Target: attiny1614
Set fuses: ['2:0x02', '6:0x04', '8:0x00']
Offset 0x02 (in 2:0x02) is the OSCCFG register and 0x02 represents 20MHz. Thus, the 16MHZ, 8MHz and 4MHz all clock the same as 20MHz, 10MHz and 5MHz.
I then tried the same sketch in IDE 1.8.16 and everything works as expected. Upload shows:
Target: attiny1614
Set fuses: ['2:0x01', '6:0x04', '8:0x00']
And all the above clocking speeds checked out correct.
I next checked uploading to a ATTiny3217 board, again with megaTinyCore, and it has the same problem. IDE 1.8.16 works fine.
I checked the version of megaTinyCore used in IDE 1, having updated it from IDE 2, and they both use the same core. I also installed the latest nightly for the IDE, the problem persists.
My immediate conclusion is there is something fishy in the way IDE 2 handles the board file in megeTinyCore. With IDE 1.8 working as expected my current conclusion is the problem must be with IDE 2.
I also had unexpected upload verification problems (after a single line change in the sketch - text to be printed to an LCD), basically stopping the MCU from working. That problem disappeared in IDE ver 1.8.
Anyone else finding similar problems?
I like working in 2 but currently, because of the clock speed problem, need to use 1.