pico-examples icon indicating copy to clipboard operation
pico-examples copied to clipboard

Add an example to trasmit RS422 signal

Open yoneken opened this issue 5 months ago • 3 comments

This example modifies the pio_uart_tx sample to implement RS-422 transmit functionality. It utilizes the PIO state machine to generate the differential signal directly, eliminating the need for an external line driver IC to send "Hello, world!"

yoneken avatar Aug 01 '25 16:08 yoneken

Example is failing to build in CI:

/opt/actions-runner/_work/pico-examples/pico-examples/pico-examples/pio/rs422_tx/rs422_tx.pio:27.9-12: syntax error, unexpected next
   27 |     jmp next    side 0b01 [3]
      |         ^~~~
/opt/actions-runner/_work/pico-examples/pico-examples/pico-examples/pio/rs422_tx/rs422_tx.pio:30.1-4: syntax error, unexpected next
   30 | next:
      | ^~~~
gmake[2]: *** [pio/rs422_tx/CMakeFiles/pio_rs422_tx_rs422_tx_pio_h.dir/build.make:73: pio/rs422_tx/rs422_tx.pio.h] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:8066: pio/rs422_tx/CMakeFiles/pio_rs422_tx_rs422_tx_pio_h.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....

This is probably because next is a keyword used by the wait and irq PIO instructions, and so pioasm doesn't allow next be used as a label, as identified by the comments on https://github.com/raspberrypi/pico-sdk/issues/1042

lurch avatar Aug 05 '25 07:08 lurch

I changed the label. Thank you.

yoneken avatar Aug 05 '25 07:08 yoneken

I changed the label. Thank you.

Thanks @yoneken , CI is building cleanly now :slightly_smiling_face:

lurch avatar Aug 05 '25 07:08 lurch