2
\$\begingroup\$

I am working on a project that requires me to use an ATtiny microcontroller with bluetooth module HC-05. I have used the module with Atmega 8 in the past using UART protocol. Can anyone help me in using this module with ATtiny 45/85. PS: I have no idea about programming arduino, and use embedded C language for my projects.

\$\endgroup\$
1
  • \$\begingroup\$ Are you able to implement a UART on the ATtiny x5? I read your question as meaning that you wish to be able to add a virtual UART to the processor you mention. | Interest but useful: What version of embedded C are you using? Is it available for the ATTinyx5? | Interest only: Where are you located? \$\endgroup\$
    – Russell McMahon
    Apr 6, 2015 at 11:42

1 Answer 1

2
\$\begingroup\$

I assume that you wish to implement a "soft" UART on the ATtinyx5 because they do not have a hardware UART. If this is NOT what you want, please provide more detail.

A UART is relatively easy to implement in software. If you can dedicate the main focus of the program to the UART so timing can be implemented with delays it is quite straight forward. If you have other tasks that occupy significant processor time then use of interrupts helps simplify code. Fortunately, a number of people have already implemented ATtinyx5 UART code and there is a range to choose from.

Here from 'Garagelab" is what looks like it may be an excellent x5 capable UART as part of a library of other x5 routines.

Here is avr-softuart on github, with a discussion on using it here. They use it to talk to an Arduino but that is obviously only an example of what it can do.

Here is another soft UART which may need some modifying for the x5 , but which has a relevant AVRFreaks discussion here

Here is code for a receive only UART for ATtiny85

This search is liable to be useful.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.