ATTINY85 using software serial error [Solved]

I am attempting setting up a basic software serial communication from an attiny85 chip to serial through an arduino uno board.
ATTINY85 chip is set to 8mhz internal oscillator

I have searched the internet and followed many examples.
Softwareserial is working ok when used directly from arduino onboard chip
The ATTINY85 chip works ok with the blink sketch

however when using this sketch:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(3,4); //rx, tx

void setup()
{
mySerial.begin(9600);
}

void loop()
{
mySerial.println(“hello world”);
delay(1000);
}

and have pins 3 and 4 connected to rx/tx on arduino uno board
I get a response in the serial window every second of ÿÿÿÿÿÿÿÿÿÿ

Has anyone seen this and knows why this is happening

I never got it working with Uno board, i tried the same way you did. At last I attached an external FTDI breakout board and monitor the serial communication via CoolTerm application.

I have just uploaded a very basic sketch that pushes serial data received to the chip on the uno board:

void setup() { Serial.begin(9600); }

void loop() { if(Serial.available()){ Serial.println(Serial.read());} delay(100); }

I now receive a list of characters, I assume these are the codes for each character in a stream like this: 104 101 108 108 111 32 119 111 114 108 100 13 10 repeat

Do you know how to change the basic sketch above to accept each character, convert it to readable text then display at end of line?

This would then work through the uno Thanks

Does this work?

Serial.println((char) Serial.read());}

May be you need to connect Atiny 3 to Uno TX and 4 to Uno RX. In uno sketch listen to serial data in the loop and print it as mentioned by Riva.

Yes guys using the below sketch:
char serialString = ‘\0’;

void setup() {

Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
if(Serial.available()){
char thisChar = Serial.read();
Serial.println(thisChar);
}
delay(100);
}

I now get a single character stream coming from the ATTINY85 serial

My original example pushes hello world on loop

so I get:

h
e
l
l
o

w
o
r
l
d

I assume the 13 and 10 are new line and carriage return…
So now I am looking to build a little serial data cache string that stores the line then prints it when it receives the carriage return…

what will happen if you do

Serial.print(thisChar);

Beautiful things happen Sony…

A console showing ATTINY85 SoftwareSerial println’s just as you would expect :wink:

I now have a cool looking console with a delay of (10) makes it look old school like it is being typed.

So just to clarify I have an ATTINY85 on a breaadboard connected to 5v, ground, reset and a wire from ATTINY TX to Arduino Uno board RX.

Run this sketch on Arduino chip:

void setup() {
Serial.begin(9600);
}

void loop() {
if(Serial.available()){
Serial.print((char) Serial.read());
delay(10);
}
}

And it works :wink:

Thanks for your help guys, hope this helps someone else looking to do similar

Good to hear the issue is resolved. Please edit the Title and append [Solved] at the beginning of the title so people knows the issue is resolved.