Skip to content

ATTiny816 RS-485 reception not without sending first #1272

@SilentResonance

Description

@SilentResonance

Hi,

at first thanks for this great project allowing to use 0/1/2-series ATTiny cores in Arduino.

I'm trying to get custom boards with ATTiny816 to run on RS-485 bus.
Most of the functions work. But after extending from one to four boards I noticed a problem.

In order to allow clean bus start, I removed all debug prints as this leads to bus traffic when starting the boards all together.
But after that, the reception of data within loop() is not working anymore.
I assume this is due to the state of the XDIR to transmit when starting with enabled RS-485 in UART peripheral.
When looking into the datasheet I could not find any register bit to force switching the XDIR to receive or any mention in errata sheet. I also searched all discussions and other issues for anything matching this problem without a result.

I prepared a minimal example ino:
ArduinoTiny816_RS485_minimal.ino.txt
The line at the bottom of setup() changes the ability to switch the relay. I used a relay so I can easily hear, if it work by sending 'S' or 's' via RS-485.

I'd appreciate any insight on the library files to look into, for fixing this.
Thanks in advance.

Best regards
Silent

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions