-1

I am wondering whether any model of the Raspberry Pi can reliably output an 8-bit 20mhz signal into 8 GPIO pins at the same time. Basically I am trying to read 8-bits from a file at a time out to 8 pins of a raspberry pi, at 20mhz (my purpose is to feed those 8 bits into a current-output DAC).

I am not sure which model of Raspberry Pi would be best for this. I'd also love to know if there are some C/C++ code examples that do this already.

Any insight or advice on this would be greatly appreciated — thanks!

0

2 Answers 2

1

No.

The benchmarks you see showing impressive Pi GPIO speeds in the multi megahertz region are for simply toggling a single pin. I.e. a loop writing 0 then 1. Once you add logic in that loop the speed drops. Once you try to time the loop the speed will drop by several orders of magnitude.

I suggest you do your own experiments reading from a file and writing to GPIO.

If you don't mind timing jitter you might reach something like 20 thousand Hz in Python (not the 20 million Hz you want).

0

I seriously doubt that you could output data at that speed; the fastest code I have used can (just) exceed 20Mbps on a Pi4 (just toggling a pin). (Outputting multiple bits with custom code is just as fast or faster than most single bit writes.)

Maybe with DMA BUT you couldn't even read data from a file at that speed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.