Hello to all habouiers. Quite recently, Comrade Himura published his UART article in ATtiny13 or How to get data from the MC for 52p , and then I remembered that I have, besides previous work on this topic, namely the Three-Channel UART ADC on ATtiny13 , there is something else, some of which I cut out from a rather curious project Happy Christmas and Happy New Year wishes from Attiny13 , there is also a software UART, both reading and sending, and something else on SPI, I generally recommend looking to anyone who is interested, though the resource is English-speaking. Here is a video of work:
Cutting off all that is unnecessary for me from the code of Comrade Vinod.S , it turned out: ')
All this takes 470 bytes, that is, less than half of the memory ATtiny13, you can still program a lot, if you skillfully use the resources of the microcontroller.
As you can see, the Hello Hbr, I'm ATtiny 13 character set is displayed using the uart_print ("...") function ; and the value of variables, for example, let the variable be called value, then the output in a line of content will be carried out using the function num_to_str (value, 4); where 4 is the number of digits, in this case, you can output a value from 0 to 9999. The lines uart_print ("\ r \ n"); finish the line when outputting to the UART and the transition to the new one is carried out, by analogy the Enter button on the keyboard. The port that will work as TXD is specified in lines #define SOFT_TX_PIN (1 << PB1) . On the ports map it looks like this:
And finally - ATtiny13 is clocked from an internal RC chain tuned to a frequency of 9.6 MHz, the divisor by 8 is disabled, this is specified by the fusion bit lf 0x7A .
PS If you heat the microcontroller to ~ 60 degrees, then the garbage will start coming, checked it personally, but this is simply the price of ATtiny13.