Synchronize read and write when using the RMT peripheral

Captain.Chode
Posts: 15
Joined: Mon Mar 11, 2019 4:23 pm

Synchronize read and write when using the RMT peripheral

Postby Captain.Chode » Thu Jun 27, 2019 2:46 pm

So I created a VAN bus protocol reader and writer library. They can be found here:
https://github.com/morcibacsi/esp32_rmt_van_rx
https://github.com/morcibacsi/esp32_rmt_van_tx
Both are utilizing the RMT peripheral and they are working on their own. However to be able to send properly (when there are multiple clients on the bus) I need to know if the line is free for some period of time. Unfortunately I have no idea where to start, should I raise a signal from the reader when it is idle? If yes how? Is there any recommendations how should I detect if the line is free? I am using sn65hvd230 CAN transceivers to interface the bus.

Captain.Chode
Posts: 15
Joined: Mon Mar 11, 2019 4:23 pm

Re: Synchronize read and write when using the RMT peripheral

Postby Captain.Chode » Fri Jul 12, 2019 1:57 pm

Studying the protocol I found out that 128 microseconds of continuous HIGH state indicates that the line is free. Basically this means that after I received a packet, I need to wait for 128 us and if no further reception was made I can transmit.
I was wondering if I could have some kind of interrupt installed after the RMT receives a whole package? Or for this to work I need to rewrite my receive library to use the RMT in interrupt mode without using the blocking thread safe api?

Who is online

Users browsing this forum: forrest and 165 guests