Go Down

Topic: ATtiny85v and SoftwareSerial Connections (Read 1 time) previous topic - next topic

jrburke99

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!

fungus

There's only 4 possibilities...it would take about a minute to find out. :)
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

jrburke99

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

fungus


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.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

jrburke99

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.

Erni

#5
Apr 03, 2013, 09:04 pm Last Edit: Apr 03, 2013, 09:07 pm by Erni Reason: 1
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

jrburke99

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

Coding Badly


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

fungus


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...
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

jrburke99

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!

fungus

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

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

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Erni

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.

Coding Badly

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.

Go Up
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:

shortcuts: alt+s submit/post or alt+p preview