Trouble with outputs from ATtiny84 (using Arduino via MAX485)

Hello all,

I’m having trouble getting output from my ATtiny84, which is programmed to use Arduino’s SoftwareSerial.

I reconstructed Nick Gammon’s RS485 network: Gammon Forum : Electronics : Microprocessors : RS485 communications

The Arduino is communicating with an ATtiny84, and I’m using MAX485’s not LTC1480s (see attached diagram). I burned the 8MHz bootloader onto the ATtiny, then uploaded Gammon’s slave sketch using Arduino as ISP. Then I uploaded the RS485 master sketch to the Arduino (master and slave sketches attached).

The trouble is I don’t think I’m getting any output from ATtiny pin 4 (PA4, the enable pin), whereas I am everywhere else along the signal chain. Is pin 4 (PA4) on the ATtiny not able to output a HIGH or LOW? Should I use one of the PWM pins, or is the problem elsewhere? Maybe the sketches contain code not covered by ATtiny (though I checked and it does handle SoftwareSerial, analogread(), etc)?

In Gammon’s diagram (attached), the 680 Ohm resistors mean (at least in my setup) that the A line on the MAX485 is always pulled high, is that right? On other diagrams I see 120 Ohm resistors between A & B lines, one at each end.

I feel like I’m close so I’d really like to get this last bit figured out. Thanks for your time!

RS485 Gammon master and slave arduino sketches.txt (3.32 KB)

I have just read a posting in the last day or so about the 680 ohm resistors the resistor are there as a safety thing to make sure lines are pulled hi/lo in the event of a link loss/disconnection.

The advice given by GrumpyMike i think it was, was to check the datasheet for the RS485 device. many of these devices hve this function performed internaly. you do however need a 120 ohm resistor across A & B at each end of your transmission line ie first and last device on multidrop or first and last device on end to end connection. if you have a look at jan Alexson explains this in more detail in his serial devive/rs485 section, the 120 ohm ids dependent on line length and supply voltage of the transmission - i think.

hope this helps if you get it working let me know, im having problems with it as well, I think Nick has got both devices to talk to each other but it doesnt appear that you can interogate it from the outside world - ie using serial monitor to see what the receiver is doing.

if he helps me to understand it i will share my findings with you