Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5323

SDK • SOLVED Re: Equivalent of __no_inline_not_in_flash_func for assembly code?

$
0
0
That was quick. I just embedded the entiire shooting match as an 'asm' statement in a C file.

It's definitely worth it. The number of machine cycles to gather 96 sets of 32-bit gpio reads drops from 319 to 309 cycles when the code is in RAM vs. flash. That's 10 cycles of jitter removed, so my timings of RC decay got much less noisy and will result in a more reliable indication of finger touch.

Shortform, I burn an average of 0.15% of a single Pico core to time the response of an arbitrary number of cap touch sensors (up to 29 for all GPIOs used, I'm using just 3) with a timing precision of 0.3%, 1 part in 309.

There's a bunch more work after this to turn the raw timings into touch/not touch, but this is the time-critical / mission-critical bit, and it's rocking 👍😀

Statistics: Posted by omenie — Sat Mar 02, 2024 12:06 pm



Viewing all articles
Browse latest Browse all 5323

Trending Articles