I'm attempting to make a very simple SoftwareSerial example on an ATTINY85. All it does it reads data from one pin (pin 2, physical pin 7) and outputs it to another pin (pin 3, physical pin 2).
The "transmitter" of the signal is an Arduino Nano and it's just toggling an LED on and off every second via pin D10.
The "receiver" of the signal, the ATTINY, I'd expect it to read in the toggling pin of the Arduino and be able to toggle its own LED in sync with the Arduino's LED.
The Ardunio's LED blinks as expected but all that's happening at the moment with the ATTINY is the connected LED stays on continuously.
I followed the set up instructions correctly, burning the bootloader, setting up the Arduino as ISP etc and the sketch gets uploaded correctly. Ground connections are common. I've double checked all the connections. I've tried a different Arduino as the transmitter and a different ATTINY as the receiver just in case somehow I managed to fry one or the other. I've tried different baud rates. I've tried using Coding Badly's TinyISP instead of ArduinoISP. I've tried dropping in NeoSWSerial instead of SoftwareSerial too. I'm using the ArduinoISP to upload the sketch to the ATTINY, and I'm on the latest version of the Arduino IDE, v1.8.5.
The transmitter (arduino) code:
int led = 10;
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(1000);
}
The receiver (attiny85) code:
#include <SoftwareSerial.h>
const int pinRx = 2; // physical pin 7
const int pinTx = 3; // physical pin 2
SoftwareSerial echoSerial(rxPin, txPin);
void setup() {
pinMode(pinRx, INPUT);
pinMode(pinTx, OUTPUT);
echoSerial.begin(4800 ); //i've tried various different baud rates too
}
void loop() {
while (echoSerial.available() > 0) {
echoSerial.println(echoSerial.read()); //i've tried echoSerial.write(... here too
}
}
Attached is a photo of the breadboard layout(s). The left board I used to program the ATTINY (it sat on the bottom 4 rows numbered 27-30) and the right board I'm using to test the ATTINY. As expected the blue led (connected to D10 of the Arduino) blinks every second however the yellow LED (connected to physical pin 2 of the ATTINY85) stays on constantly. Any ideas for what to check next would be greatly appreciated.
It's probably worth saying I'm a super-newbie with this stuff, I hadn't even heard of an ATTINY until a week ago so I'm sure someone more experienced will be able to figure this one out with relative ease.