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

General • Re: Using PIO to perform XOR between PIN and OSR(lsb)

$
0
0
I would implement it as a Finite State Machine (FSM) where the state is whatever the output is, then change state or not depending on the bit pulled in. Something like -

Code:

OutputLow:  set pin, 0  receive bit  if bit == 1 then jmp OutputHigh  jmp OutputLowOutputHigh:  set pin, 1  receive bit  if bit == 1 then jmp OutputLow  jmp OutputHigh

Statistics: Posted by hippy — Wed Mar 12, 2025 2:48 pm



Viewing all articles
Browse latest Browse all 8621

Trending Articles