1

As far as I understood ATTINY85 doesn't support serial communication. I'm trying to understand how to do this via code.

Is is possible to specify BAUD rate or set some kind of communication speed rate and use a register like this to send a value?

 PINB0 = 0x63;

If not, then as far as I understood I have to use the low level approach, but I'm a bit confused how this really works.

As far as I understood, based on my ATTINY85 CPU speed and target BAUD rate, I need to calculate expected 'intervals' between each 'high' and 'low' I'm going to send out to simulate serial communication for the other device to understand. Correct?

[start identifier?] 0 [5ms] 1 [5ms] 1 [5ms] 0 [5ms] 0 [5ms] 0 [5ms] 0 [5ms] 1 [20ms]

Where can I find out more about the correct intervals and logic behind this? Thanks!

0x29a
  • 471
  • 1
  • 6
  • 21
  • The term you are looking for is bit banging https://en.wikipedia.org/wiki/Bit_banging – Axis Oct 19 '16 at 00:54

1 Answers1

1

AVR307 describes how to implement a half duplex UART using the USI found in the ATtiny85. Due to the nature of the USI it is not possible to implement a full duplex UART.

Ignacio Vazquez-Abrams
  • 48,488
  • 4
  • 73
  • 103