* The same fault occured with both 74HC and 74LS chips, but only on
my newer batches of Mega16s and Tiny26s.
This sets my alarm off.. The input threshold in HC is 1/2 VCC, and the gates neither source or sink any appreciable current.
So, something's fishy.
Common ground between the chips?
Same VCC rails?
Hang a scope on it and see what you see.
I've used a lot of HC chips with AVRs, and I've not had a problem, nor would I expect one.
* In both cases, the problem was cured by fitting external 100k
pulldown resistors. NO CODE CHANGES.
So you're seeing that the gate outputs are so weak that a 100k pulldown is a significant improvement? Something's fishy.
* I know it sounds like I had the pins configured as inputs and using
the internal pullup to pull it high, but thats just not the case.
Sanity check here: Unlike the pic, 1 = output and 0 = input.