ATtiny85v and SoftwareSerial Connections

I have an Arduino UNO, and have it connected to an ATtiny85v on a breadboard. I am using the UNO as the ISP. It is running TinyISP, and I have enabled SoftwareSerial. On the ATtiny85v, I am able to enable SoftwareSerial, and I can send data to a terminal window. That all works just fine.

But I now need to be able to send data to the ATtiny85v, but I am unsure how to set that up. I have Arduino pin 12 connected to the ATTiny pin 1 (PWM, MISO), and I use that as my TX pin in my sketches that I load up to the ATTiny85v. This has worked just fine so far for having the ATtiny85v send data to the serial monitor.

So what pin do I set for RX on my ATtiny sketches, and what pin on the Arduino UNO do I connect that to?

Thank you!

There's only 4 possibilities...it would take about a minute to find out. :slight_smile:

There are 4 pins on the ATtiny that it could be, and 19 on the Arduino, which gives 76 possibilities.

jrburke99:
There are 4 pins on the ATtiny that it could be, and 19 on the Arduino, which gives 76 possibilities.

(Assuming you have no manual, no google and don't know how to use your computer to find a file called "SoftwareSerial.h"...)

You could temporarily use HardwareSerial on the Uno to find out which pins work on the Tiny, then vice-versa to find out what pins SoftwareSerial is using on the Uno.

ie. use your imagination.

Obviously you do not actually know the answer, otherwise you would have simply given it rather than speaking in riddles. I have used Google, and found lots of nothing, and a few possibilities, all of which did not work for me. In one post, it was stated that the default wiring used to program the ATtiny85v with the Arduino UNO as the ISP is already set up for serial connections. I found that to be true for sending data from the ATTiny85v to the serial monitor, but receiving does not work.

Do I really need to type more to prove that I know what I am doing, but have a simple question that I have been unable to find an answer to through regular channels? I would greatly appreciate a simple and precise answer other than "RTFM and Google". Thank you.

The answer is in the original thread about TinyISP:

http://arduino.cc/forum/index.php/topic,123388.15.html

reply #27

• Digital pin 12 on the Uno is receive. Connect transmit from the target to pin 12 on the Uno. This pin is also used when programming the target (MISO).

• Digital pin 14 (A0) on the Uno is transmit. It can be left unconnected or it can be connected to receive on the target.

And here, although not specifically clear

http://www.ernstc.dk/arduino/tinycom.html

Great. Thank you. So now what do I connect A0 to on the ATtiny85v? Should it be pin 0 (PWM, AREF, MOSI)? Or should it be one of the Analog In pins? I tired pin 0, and that seemed to work as a test, but when I run the TinyTuner sketch, it does not seem to be receiving anything under the same setup...

Is the immediate goal to tune the processor using Tiny Tuner?

jrburke99:
I tired pin 0, and that seemed to work as a test, but when I run the TinyTuner sketch, it does not seem to be receiving anything under the same setup...

So don't use TinyTuner...

The goal is indeed to use TinyTuner to adjust the internal oscillator. This is the easiest way I have found. If it worked, of course. But I don't know that I have tried it with everything properly connected. Thus the purpose of this post. To double-check my current knowledge base. My main goal is to learn. I have no immediate NEED of any of this. Just hoping somebody can help me to learn some new things. Thank you!

SoftwareSerial is highly dependent on the accuracy of the system clock.

It's not really surprising that changing the clock will affect SoftwareSerial.

I am not sure if you can use the TinyTuner with the TinyISP ?

Anyway if you downloaded the TinyTuner from here:

http://arduino.cc/forum/index.php/topic,8553.0.html

There are four examle sketches in the package, and they include instructions how to use them.

You will need a Serial/USB converter. If you don't have one you can use your Arduino Uno:

Connect a jumperwire from reset to ground.

For safety you should first upload an empty sketch to the UNO, and connect a 220 ohms resistor between tx/RX on the tiny and Arduino.

jrburke99:
The goal is indeed to use TinyTuner to adjust the internal oscillator.

The serial bit timing is used to tune. For a real UART the method works well. SoftwareSerial is not a real UART; the timing is not very precise. SoftwareSerial will not work well for tuning.

You can use the UART on your Arduino (the USB-to-serial converter) by connecting a jumper between RESET and GND (on your Arduino) and then connecting RX, TX, and GND from the programmer (your Arduino) to the target (the ATtiny). As Erni mentioned, you need to include 220+ ohm series resistors on RX and TX to protect both sides. I know up to 5.1K ohm resistors work well. Higher values may also work.

Alternatively, I have a new version of Tiny Tuner that integrates with TinyISP. If you are interested in using it let me know.