I have a Raspberry Pi, a 74LS245, and an ATTiny85.
I connected the Pi to the Tiny through 1k resistors, and am able to use SPI to program it, no problem.
I have added a 74LS245 inbetween, to electrically isolate the attiny. On a new AtTiny, I'm able to program it without issues, so I have apparently connected the pins correctly.
The issue is that when the device is programmed to have an output pin PB2 as high (I was testing), the SCLK is then unable to be driven low, and then programming can't happen.
Sadly, I'm not an EE by training or even by practice, and I'm kind of at a loss for how to "correctly" make the 74LS245 overpower the output pin of the ATTiny.
I'm hoping I've been explicit enough, and if there's a diagram I should be following, I'd love to see it.
Edit: Some follow up experiments:
- DDRB = (1 << PB2); PORTB |= (1 << PB2); causes the issue repeatedly.
- Set PORTB to zero, and it doesn't happen.
- When the SCLK can't be driven by the 74LS245, it can be driven by the Pi.
- However, only if it's directly connected, and not through the 1k Resistors I have between the Tiny and the 245.
There is no modification needed for MOSI or MISO. Those work directly being driven by the 74LS245, and the device doesn't care what condition the pins are in before.
The reset functionality is operational, and the pins are driven to a hold. On PB2, however, this is a "1" is the port had previously been set to out.