Pages: [1]   Go Down
Author Topic: Attiny85 9600 baud rate question  (Read 1259 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 201
Posts: 8694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3955
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

"The old Europe"
Offline Offline
Edison Member
*
Karma: 1
Posts: 2005
Bootloaders suck!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

• 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!

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: