Go Down

Topic: Attiny85 9600 baud rate question (Read 1 time) previous topic - next topic

sl_guy

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

johnwasser

You can program the ATtiny85 using the Arduino IDE:

http://hlt.media.mit.edu/?p=1229

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: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

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.
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

madworm

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!

sl_guy

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

Go Up