gcormier / megadesk

Open-source IKEA Bekant controller board
GNU General Public License v3.0
717 stars 53 forks source link

ATTiny1624 Support #107

Closed gcormier closed 2 years ago

gcormier commented 2 years ago

ATTINY1624 branch up in case the availability (or pricing) of this becomes better then ATTINY841.

Pros

Cons

Need to work on code.

gcormier commented 2 years ago

@philwmcdonald Unsure if any of the optimizations you made are related, I've only just flashed the first test and noticed the pitch is higher on the startup tone. Later this week I'll poke around. I'll probably just also flash a 4 line program that outputs a given frequency tone and measure it with the scope to see if it's something at the core of my configuration.

gcormier commented 2 years ago

Woops, I thought I read the fuses set the default clock to 16MHz. The 1624 runs at 20MHz by default. A fuse change gets us at 16MHz to save a bit of power.

gcormier commented 2 years ago

image

Serial oddities on LIN bus. Top is 1624, bottom is tiny841. No code changes. 1624 is not pulling low for 775uSec.

philwmcdonald commented 2 years ago

Lin::serialBreak() likely doesn't play nice with hardware serial. it delays for: breakTime = LIN_BREAK_DURATION*TBIT; // 780us break time May need a different approach...

It's also possible txPin passed into the constructor isn't correct, or that serialBreak() requires: pinMode(txPin, OUTPUT);

philwmcdonald commented 2 years ago

Never found a need for all that eeprom previously. You could just initialize/use 256b instead without any impact to the operation of megadesk.

gcormier commented 2 years ago

Bingo, setting pinMode fixed it!

gcormier commented 2 years ago

Serial working well on 1624

image

gcormier commented 2 years ago

Tested build against attin841, fixed some issues. Working!