I have spent the evening reading the ATmega32U4 datasheet and wow, just WOW. For the past couple years I've thought the 32U4 was just a 328 with silicon for handling USB (just basic interrupt class transfers with single byte storage). This thing is a whole new beast.
-- Timer 0 1 and 3 share clock prescalers. This means we can't mess with Timer1 speed to generate servo signals without affecting Timer 0 and 3 speed as well. These will have to be examined t find timers and scalers that support the millis() timer, servo period, blower PWM, 4khz alarm beeper, and LCD backlight all with the same scaler?
-- 8 bit Timer 2 is gone. Oh no, our servos!
-- New Timer 3 is 16 bit hooray!
-- New Timer 4 is 10 bit and supports 3 channels of output. Also it can run up to 64MHz
. Even at 0.5MHz this could reduce the output inductor from 220uH to 27uH which would make it much smaller. Unfortunately our P-MOSFET can't switch that fast (it is already at its limit with the 2.2k resistor and its gate capacitance) so this should be re-evaluated. For those interested, the 32u4 has a PLL that the 328 didn't have which generates 48MHz for the USB bus and can drive the I/O clocks as well. That's pretty awesome.
-- 4 external interrupts (up from 2)
-- 12 analog inputs (6 single ended), differential ADC input with selectable amplifier. We could almost do the thermocouple just with this if the resolution was better on the high gain differential input
-- Internal ADC reference of 2.56V boooooooo. This more than halves the resolution of the low-end (below ~425F) thermocouple input.
-- Full USB FIFOs for real USB data transfer
Certainly a really cool chip which makes sense due to it being like 4 years newer and more than twice the cost of the atmega328. The downside is that there's a lot more to porting the code than just making it work at 8MHz and also it would be good to reorganize the HeaterMeter pinout to better match the new pin functions. There's also the question of compiling all the LinkMeter code for this platform which isn't fully supported by OpenWrt trunk yet, and may not be ever due to the whole OpenWrt developer feud/split. Definitely a neat little device but my main focus is still the HeaterMeter 4.3 software currently.