Pages: [1]   Go Down
Author Topic: ATtiny45 serial communication  (Read 2504 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 am using an Uno to program an ATtiny45 microcontroller.  The goal of my project is to read values from a gas sensor. Now that I have successfully programmed the ATtiny with codes that blink LEDs and other basic things, I need to know if I can use the Serial Monitor with the Arduino IDE to communicate with the microcontroller. Are there equivalent ports to Arduino's TX and RX?

Thank you
Logged

Denmark
Offline Offline
Edison Member
*
Karma: 35
Posts: 1058
Happy Hobbyist
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you mean communicate with the Attiny45, then you can use the
TinyDebugSerial. You get the serial output on PB3 (physical pin 2)

you can only use speeds 9600, 38400 and 115200 for example

  Serial.begin(9600);
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8475
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Having done that you need to convert the 5v serial to USB with a serial->USB converter like the FTDI cables.

Quote
Are there equivalent ports to Arduino's TX and RX?
No, although the USI can be forced to look a bit like a UART.

______
Rob
« Last Edit: June 20, 2012, 05:28:07 pm by Graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

Dallas, Texas
Offline Offline
God Member
*****
Karma: 30
Posts: 887
Old, decrepit curmugeon
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The TinyDebugSerial that is part of the core maps to the Serial class, so you can write a sketch that sends data from the tiny to your computer, but not receive it.  The core only supports transmitting to the computer.  Depending upon the speed used the transmit pin changes. When the speed is 16MHz, the transmit pin is PB2 (pin 7) and for speeds of 8MHz or less it is PB3 (pin 2)

It also only supports speeds of 9600, 38400, or 115200 baud and they can't be specified as a variable.
« Last Edit: June 21, 2012, 05:56:03 am by wanderson » Logged

New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

Offline Offline
Jr. Member
**
Karma: 0
Posts: 64
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You could try SoftSerial library.  Be careful with the baud rate vs clock speed of your ATtiny.
Logged

Pages: [1]   Go Up
Jump to: