The application note is based on the ATtiny26 which has a more primitive timer/counter than the ones in the ATtiny85, and so requires you to reprogram the timer for each of the 8 bits in the byte being received. The ATtiny85 does provide a hardware USI, which can be used to implement two-wire I2C or three-wire SPI, and this can be used to do part of the job in implementing a UART Atmel have written an application note describing how to do this. One way to implement serial communication on the ATtiny85 is using software, but this requires tricky programming to get the timing correct, and ties up the processor making it difficult to synchronise reception of the data with other tasks. Although there are some published routines to do this, they were all a bit complicated, so I set out to write a minimal routine that would do just what I wanted. I wrote this to receive a 9600 baud serial signal from a GPS module using an ATtiny85 processor. This article describes a simple receive-only serial UART for the ATtiny85, using the USI (Universal Serial Interface), the basic serial communication module provided on most ATtiny chips.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |