1
\$\begingroup\$

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.

\$\endgroup\$
4
  • \$\begingroup\$ Welcome. Use a CMOS 74HC245 as it will work at 3.3 volts to 5 volts. Is this a bi-directional data bus? \$\endgroup\$
    – user105652
    Commented Jul 12, 2020 at 2:38
  • 2
    \$\begingroup\$ to program the attiny, isn't it supposed to be held in reset by the programmer? \$\endgroup\$
    – vicatcu
    Commented Jul 12, 2020 at 3:01
  • \$\begingroup\$ Yes -- the transmission protocol apparently flips between which is master and which is slave several times. However, the issue is that I have a PB2 high, and it doesn't seem to be able to be driven low for the sclk. I think. Although, I will look into getting the CMOS version. \$\endgroup\$ Commented Jul 12, 2020 at 3:02
  • 2
    \$\begingroup\$ The reset line is held low, but that doesn't appear to reset the pin to its initial state on its own. Maybe I misfused it. \$\endgroup\$ Commented Jul 12, 2020 at 3:05

0

Browse other questions tagged or ask your own question.