MichaelJonker / HardwareSerialRS485

Arduino Software for RS485 support with collision detection and message handling capabilities
MIT License
107 stars 29 forks source link

Using alternate IO pins for the DE & WE #10

Closed fbnts closed 3 years ago

fbnts commented 5 years ago

Hi,

Is it possible to use different pins to D10 & D11 like D2 & D3? For my project I use SPI which conflicts on D11 and also, D2 & D3 are right next to TX/RX pins and makes for a tidier circuit and eventually PCB layout.

I see the pins are set in HardwareSerialRS485_Helper.h but it talks of using the same port, is that both pins need to be on the same port as each other, or the same port as something else?

Thanks Tom

MichaelJonker commented 3 years ago

Oups, I do not know why I missed this question... here is a late answer you may read 'same port' in the sense of 'same to each other'

It is fairly straight forward to use different pins as long as they are not on two different hardware ports. This is because the software can then change the RE/WE mode atomically with a single instruction.

Cheers