Replies: 7 comments 7 replies
-
@Crsarmv7l If you're interested, I can push my work-in-progress files into a new branch here. Like I said before, it doesn't work and I'm not sure why, but maybe it will be useful to you. |
Beta Was this translation helpful? Give feedback.
-
Some very interesting results from playing around with fifo refills.
That actually worked pretty decently, netting about 82-89 bytes out of 100 attempted, testing with 2 Kbaud and 8 Kbaud. Kinda jank though and wont be consistent. Plus I wonder if it was 82-89 bytes in order (Could be bytes 1-64, then some random ones) . No data integrity test. I also messed with the SPI freq which improved things a bit, but also inverted the signals at some point. A rxed signal would be AAAAAAAAAAAAAA555555555555555555 or even alternate back and forth. This idea was borne from Table 22 SPI Interface Timing Requirements on page 30 of the datasheet.
Still need to set up fills and burst writes, but to start with: I set up GDO2 as follows for the interrupt (triggers a flag func with volatile bool) Just to test it was triggering correctly, I loaded up the FIFO fully with 64 bytes and read TXBYTES before strobing TX. It showed 64 bytes. Sent tx, and once the interrupt triggered read TXBYTES repeatedly. It showed 4, 4, 3, 3, 2, 2, 1, 1, 0, 0 !!!!! WOOOO triggering where it should. These readings are a bit misleading as my SPI Freq is currently set at 5500000 which is a lot faster than default. I need to run the tests again at normal Radiolib SPI speed as between the read start and read end, a byte was sent. With that kind of stat on normal spi freq it would give a decent compensation factor. More tests required but a decent path forward (The correct way would probably be DMA, as even with the ISR and trying to compensate for the SPI transaction there is no way the FIFO doesn't outrun me.... but DMA is way out of my wheelhouse.) |
Beta Was this translation helpful? Give feedback.
-
😮💨 Just found a stupid mistake I made that renders everything I tried inaccurate. In a for loop transferring from the main buffer to a smaller buffer used for burst write I was using my position in the main buffer (txPos) in the transfer reference with txPos++ instead of i + txPos. After the burst write I was setting txPos = txPos + small buffer, so it was all being incremented twice. I fixed the above. Don't want to change where we are in the main buffer until after the burst write, and I allow the small buffer to be filled with a gate that stops another fill until after the ISR asserts and the burst is written. I wonder if this issue was present in my other versions.... I still like the interrupts better. Fixed and try again later... |
Beta Was this translation helpful? Give feedback.
-
Kinda throwing in the towel. Set up an interrupt for FIFO_THR and an interrupt for FIFO Full. Best throughput I could get was 97 bytes, which would be fantastic if it was consistent. But it wasn't. I would typically get between 80 -93 bytes. The sx1276 looks like a really good substitute but also appear to be register access and not stream. Seems like the stream chips don't have OOK. I'll have to make do with 64 bytes |
Beta Was this translation helpful? Give feedback.
-
On the other hand... there is this repo /~https://github.com/hideakitai/ESP32DMASPI Might be worth a try, but I don't have high hopes on my ability to integrate it, if it can even work with Radiolib. |
Beta Was this translation helpful? Give feedback.
-
Guh @jgromes was right again. With a simple sketch at 8 Kbaud and my modifications to the CC1101 lib, the first two signals were 99.5 byte throughput and 98 bytes throughput out of 100 bytes. Sigh. That means there is some issue with my multiple loops that is preventing the refills. |
Beta Was this translation helpful? Give feedback.
-
Getting there now about 96 - 98.5 bytes out of 100 are making it through. Got a couple ideas to try now that I know it isn't an issue filling. Might be able to drop to a single interrupt too. |
Beta Was this translation helpful? Give feedback.
-
Branching a topic from here: #842 (reply in thread)
and here: #842 (reply in thread)
After a bit of work last night, I was able to send (and verify via rx on a different computer,) 97 bytes via the FIFO (granted I was trying to send 100 bytes so still a lot of work to be done).
Key points and settings for what I currently did:
Downsides:
I am doing this in the simplest way possible. Hammering TXBYES with SPI transactions and plopping bytes in one by one with SPI. I was using a 2 kbaud Datarate for TX which is relatively slow, and the FIFO still ran dry before the last 3 bytes made it in. Once the FIFO runs out the packet is done.
Ti DN500 also discusses interrupt usage which is clearly needed and what is present in the Stream examples. The Link2 example provided by Ti uses the interrupt by setting FIFO_THR and configuring IOCFG2 to assert/de-assert. Pretty complex which is why I started with the simplest possible form via SPI.
I'll see what I can do with interrupts, but at least now I know it is possible.
Beta Was this translation helpful? Give feedback.
All reactions