NathanY3G / rp2040-pio-emulator

RP2040 emulator for the testing and debugging of PIO programs
Apache License 2.0
43 stars 7 forks source link

In instruction not supported #102

Closed romain145 closed 1 year ago

romain145 commented 1 year ago

Using the "in" instruction doesn't seem to be supported by the emulator. The decoder does not have a ""_decode_in" method in its decoding_functions.

The following program does not generate anything:

program = """
loop:
    in pins, 8
    mov osr, isr
    out pins, 8
    set pins, 1
    set pins, 0
    jmp loop
"""
aaronjamt commented 1 year ago

Can you provide a complete program that demonstrates this issue? Also, when you say "does not generate anything", what does that mean? This project doesn't have the ability to handle PIO assembly in its textual form, you have to use another program or library to convert it to opcodes first. If you mean that that program doesn't generate valid opcodes, that is outside the scope of this project.

NathanY3G commented 1 year ago

Hi @romain145. Thanks for taking the time to report a problem. This issue might be due to the version of the library being used. The _decode_in() function was only added about 2 months ago by this commit. Please could you specify which version of the library you are using? One way to check this is by entering the following into your Python REPL:

import pioemu
pioemu.__version__

If you are on the latest version but still have a problem then providing a more complete example as suggested by @aaronjamt would really help. Thanks :slightly_smiling_face:

romain145 commented 1 year ago

I was using version 0.80 installed with pip: https://pypi.org/project/rp2040-pio-emulator/0.80.0/ Using HEAD https://github.com/NathanY3G/rp2040-pio-emulator/commit/4c5560ec980a81b7512c52bdee4e8d18c50e8376 now the code runs as expected :) Thanks!

NathanY3G commented 1 year ago

Great! Thanks for letting us know @romain145. If you have any more problems, questions or ideas then please feel free to post to discussion https://github.com/NathanY3G/rp2040-pio-emulator/discussions/2. Alternatively, just create another Issue.