1.5.0 work/information #512
SpenceKonde
started this conversation in
Development Plans
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I can no longer delay #431. All the new features and fixes are going into tiny, but half the core including the parts people care about were in tinymodern, which is neither of those things - more like the fever dreams of a programmer who fell asleep reading a book about the C preprocessor written by the devil himself.
Working on wiring.c, to do the 841/441, 828, and 1634 startup tuning as well as support a tuning sketch I'm mostly done which allows either a train of 1ms pulses from a known good timebase, a series of 0x01 chars at 9600 baud or 14400 baud.
Also need to port the PUE stuff into the old wiring_digital, but that won't be hard. Pulled in the digitalWrite/ReadFast functions. from megaTinyCore (also not hard).
PWM for 828/841 partly completed. Will be done differently in the two of them in the details, but the same on the big picture - basically, that the COM bits are configured at the very beginning, in init(), as are the mux bits, and we turn PWM on and off per pin with the Output Enable bits.
828 will have flexible PWM (2 pins per timer channel, with the caveat that if you analogWrite both of them they'll both output the second duty cycle requested. This will be clearly documented; so don't do that if that's not what you want. This is largely because the output enable bitmask is the same as the port bitmask, so this was the easiest way to do it, and the most flexible.
841 (and 441)
On the 841, unfortunately, TOCCn is offset from the PORTA bitmask by. I think I'm going to use a special set of values on the digital_pin_to_timer_PGM table - since we don't use TOCC0 or TOCC1, the high 6 bits will be the output enable bitmask, while the low 2 bits will be the timer number. Not worth a super-graceful solution (and that's how we currently do it for the x7's flex timers too, or something very similar to it. There's only so much grace that these wacky one-off parts deserve!
Mercifully, on the 1634, PWM is normal - it is pretty normal as a chip, in general shrug
I think I spotted a serious defect in handling of USARTs on parts that have more than one that needs to be addressed. will payi dividends in a significant amount of flash and ram. Generally finding and fixing a lot of things that were done very poorly in the past. It really shows that I wasnt as good at programming when I did a lot of that work.
Beta Was this translation helpful? Give feedback.
All reactions