3 ms·
Although there is a C compiler for the PRU, the last time I checked it produced quite less than optimal performance compared to hand assembly. The instruction s
by bradfa 4y ago
Although there is a C compiler for the PRU, the last time I checked it produced quite less than optimal performance compared to hand assembly. The instruction set is pretty simple so it’s not horrible to write by hand. Maybe they’ve made big strides in the C compiler capabilities recently?
- binarycoffee 4y agoNot only is the instruction set simple, but the clock-per-instruction cost is deterministic, so assembly code is ideal for real-time I/O. Just like GP, we found that we could often use a PRU in place of an FPGA and dramatically cut development cost (this was for very small production series). One use case for C is communication with the CPU (remoteproc stuff). We commonly had one PRU handle CPU communication with trivial C code while another PRU on the same PRU subsystem was coded with assembly to handle real-time I/O.