No0ne / ps2x2pico

USB keyboard/mouse to PS/2 interface converter using a Raspberry Pi Pico
MIT License
196 stars 35 forks source link

Pio Update #6

Closed hoffman373 closed 1 year ago

hoffman373 commented 1 year ago

Updated pio assembly program to:

hoffman373 commented 1 year ago

I have tested the keyboard support, but I have not tested the mouse. If you guys are interested, take a look at the branch and see how it works and what you think about it.

No0ne commented 1 year ago

Thanks for the PR, had a short look into it: changing the pins has to be done on the HV side since I used a fixed PCB for that, see https://raw.githubusercontent.com/No0ne/ps2x2pico/main/hw1.jpg I will try to fix the mouse support and merge it afterwards, thank you!

hoffman373 commented 1 year ago

I am going to make a pcb board with ps/2 headers and the level shifter all on one pcb.

I've used osh park to make PCBs that are nice for hobby work.

On Sat, Jan 28, 2023, 12:45 PM No0ne @.***> wrote:

Thanks for the PR, had a short look into it: changing the pins has to be done on the HV side since I used a fixed PCB for that, see https://raw.githubusercontent.com/No0ne/ps2x2pico/main/hw1.jpg I will try to fix the mouse support and merge it afterwards, thank you!

— Reply to this email directly, view it on GitHub https://github.com/No0ne/ps2x2pico/pull/6#issuecomment-1407449209, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSDYMQUFXOFVH5BZDQ7BJDWUVLK5ANCNFSM6AAAAAAUJYBGMY . You are receiving this because you authored the thread.Message ID: @.***>

hoffman373 commented 1 year ago

I tried to find a way to not change the pin orders. The 32 instruction limit drove me nuts.

On Sat, Jan 28, 2023, 1:00 PM Dustin Hoffman @.***> wrote:

I am going to make a pcb board with ps/2 headers and the level shifter all on one pcb.

I've used osh park to make PCBs that are nice for hobby work.

On Sat, Jan 28, 2023, 12:45 PM No0ne @.***> wrote:

Thanks for the PR, had a short look into it: changing the pins has to be done on the HV side since I used a fixed PCB for that, see https://raw.githubusercontent.com/No0ne/ps2x2pico/main/hw1.jpg I will try to fix the mouse support and merge it afterwards, thank you!

— Reply to this email directly, view it on GitHub https://github.com/No0ne/ps2x2pico/pull/6#issuecomment-1407449209, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSDYMQUFXOFVH5BZDQ7BJDWUVLK5ANCNFSM6AAAAAAUJYBGMY . You are receiving this because you authored the thread.Message ID: @.***>

No0ne commented 1 year ago

True, the instructions limit is hard, thats why I did the receive start interrupt. Changing pins is OK, just leave the LV pins connected the current GPIOs and change the HV label and the software pin.

hoffman373 commented 1 year ago

OK I follow you. I changed the README to reflect the HV being swapped.

No0ne commented 10 months ago

Can you tell me at wich lines in the PIO programm you took advantage of the swapped data/clock pins?

hoffman373 commented 10 months ago

Yes. Let me write you back tomorrow. Sorry for the delay.

hoffman373 commented 10 months ago

OK, I it has been a few months since I have worked on this. But this is what I remember. On line 17 "wait 1 pin 1" waits for clock to go high by indexing off of the value set on line 81 with the C function call "sm_config_set_in_pins(&c, dat);"

On line 32 we read data from from the same pin set on line 81.

If we were to flip the order of the pins, then line 17 would become "wait 1 pin 0", which is totally fine, however on line 32 we would be reading from the clock pin instead of the data pin.

Without using wait the program needs more instructions in order to check the clock for high on line 17

No0ne commented 10 months ago

Thanks, understood!