Skip to content

Instantly share code, notes, and snippets.

@shirriff shirriff/PRU code
Last active Jan 8, 2018

Embed
What would you like to do?
Fragment of PRU code to output Manchester-encoded data.
for (bit_count = 0; bit_count < 8; bit_count++) {
if (byte & 0x80) {
wait_for_pwm_timer();
__R30 = HIGH << WRITE_PIN;
wait_for_pwm_timer();
__R30 = LOW << WRITE_PIN;
} else {
wait_for_pwm_timer();
__R30 = LOW << WRITE_PIN;
wait_for_pwm_timer();
__R30 = HIGH << WRITE_PIN;
}
byte <<= 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.