Go Down

Topic: Attiny85 9600 baud rate question (Read 2303 times) previous topic - next topic


I'm a newbie to Arduino so please give me some guidance.
What I'm trying to do is to figure out if I can get the attiny85 to communicate with RFID reader via serial comm. at 9600 baud rate.
I'm not sure if this is doable or not. If not, do you suggest any other microcontrollers? I have a Arduino Uno and have done couple sketches. I know C/C++ programming quite well.
Thank you in advance


You can program the ATtiny85 using the Arduino IDE:


Unfortunately it doesn't have an asynchronous serial port so you can't put a bootloader on it.  You MIGHT be able to run NewSoftSerial on it to talk to your RFID reader.

Unless size (or cost) is absolutely critical you would probably be better off using a ATmega168 or ATmega328.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

Jack Christensen

I doubt hardware serial will work, the hardware is lacking, as John noted.
I tried NewSoftSerial and it appears to use ATmegaXX8-specific registers.
Still, I'd think something similar would be possible, GIYF, let us know what you find!
Given that, I might either calibrate the internal oscillator, or use a crystal or resonator.
OTOH, I've run 9600 on a m328 using the 8MHz internal oscillator with no more than the factory calibration, and it seemed to work fine, but that's just one instance, I might have gotten lucky.


Writing your own 'soft-serial' for ATtiny chips is not that hard at all. It can be done with a combination of a pin-change-interrupt to capture the start bit and a compare-match timer to do the bit-sampling.

I had the same problem (no uart) with an ATtiny24, and it works reasonably well that way.
• Upload doesn't work? Do a loop-back test.
• There's absolutely NO excuse for not having an ISP!
• Your AVR needs a brain surgery? Use the online FUSE calculator.
My projects: RGB LED matrix, RGB LED ring, various ATtiny gadgets...
• Microsoft is not the answer. It is the question, and the answer is NO!


thanks everyone! I have decided to go w/ the ATmega328. This forum rocks and everyone here is so helpful.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131