RS485 driver

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
Post Reply
mvdw
Posts: 25
Joined: Tue May 26, 2015 11:57 pm
Location: Brisbane
Contact:

RS485 driver

Post by mvdw » Wed May 06, 2020 8:04 am

I am developing on a board with RS485 line drivers; these are half duplex where the direction is controlled by a DE pin. This is easy to configure iun STM32Cube IDE, but how do I translate this into micropython?

I'm thinking that it may be possible to subclass the uart class with the extra DE pin functionality? For my application the micropython device is the bus master so arbitrates the bus, making the design a little easier.

Before I go reinventing the wheel has anyone done anything with RS485 and micropython?

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: RS485 driver

Post by pythoncoder » Thu May 07, 2020 4:54 am

I don't know if this has already been done - a forum search might be your friend.

Re implementation in Python:
In general subclassing built-in types is not well supported by MicroPython. It's usually best to use composition rather than inheritance.
Peter Hinch
Index to my micropython libraries.

Post Reply