I spent days trying to make Annex to read and process a clock/data serial data with a cycle duration of 250us (pulse 100us pause 150us) without any luck. Looks like the ESP32 v3 running Annex RDS is too slow to read this data... any ideas on how to solve this?
I attached screenshots of a simple test program to read data synchronous with the clock signal and change a test output that shows the symptom. The data is on channel A and what the program sees is on B. Clock is identical to data signal on A.
Digital IO read cycle too slow
Digital IO read cycle too slow
You do not have the required permissions to view the files attached to this post.
- cicciocb
- Site Admin
- Posts: 2101
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 450 times
- Been thanked: 1389 times
- Contact:
Re: Digital IO read cycle too slow
I think that you cannot achieve what you want in that way.
I can implement some functions to do that
I can implement some functions to do that
Re: Digital IO read cycle too slow
Thank you for the reply! Can you suggest any other way to read the data fast enough and decode it later - like iobuffer or similar?
Re: Digital IO read cycle too slow
Or maybe some way to increase the interrupt priority to real time? Or similar
- cicciocb
- Site Admin
- Posts: 2101
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 450 times
- Been thanked: 1389 times
- Contact:
Re: Digital IO read cycle too slow
I'm actually off so I cannot help you. The idea is to implement a new function, or with SW bitbang or using the SPI as slave
Re: Digital IO read cycle too slow
I like to stick with the wonderful world of interpreted BASIC but I also need extreme speed sometimes. An interesting approach would be to use the PicoMite as a companion to the Annex32. Thanks to the PIO state-machines, I am now able to interface with high-speed quadrature encoders. I'm not yet writing the actual assembly code myself but there are already some good examples to use as templates. I imagine PicoMite BASIC simply reading the data and sending it to the Annex32 via UARTS.
- cicciocb
- Site Admin
- Posts: 2101
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 450 times
- Been thanked: 1389 times
- Contact:
Re: Digital IO read cycle too slow
For the quadrature encoders there is a specific function available in annex that rely on the H/W counter.[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Tue May 07, 2024 1:50 pm I like to stick with the wonderful world of interpreted BASIC but I also need extreme speed sometimes. An interesting approach would be to use the PicoMite as a companion to the Annex32. Thanks to the PIO state-machines, I am now able to interface with high-speed quadrature encoders. I'm not yet writing the actual assembly code myself but there are already some good examples to use as templates. I imagine PicoMite BASIC simply reading the data and sending it to the Annex32 via UARTS.
Is not really documented but you can find the info on the forum.
Edit: details here [Local Link Removed for Guests]
- cicciocb
- Site Admin
- Posts: 2101
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 450 times
- Been thanked: 1389 times
- Contact:
Re: Digital IO read cycle too slow
The actual implementation is with only one encoder but the library supports 8 encoders (for the classic ESP32).[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Tue May 07, 2024 5:37 pm This is incredibly
Just the one encoder though, right?
Re: Digital IO read cycle too slow
How much beer can you drink?[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Tue May 07, 2024 6:13 pm The actual implementation is with only one encoder.....