Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pio Update #6

Merged
merged 3 commits into from
Feb 11, 2023
Merged

Pio Update #6

merged 3 commits into from
Feb 11, 2023

Conversation

hoffman373
Copy link

Updated pio assembly program to:

  • honor host interruptions while device is trying to send
  • allow sending to occur without interrupts
  • send flags bytes to indicate a send success as well as a send failure
  • updated host send detection logic
  • added comments
  • had to swap clock and data pin order to ease reading from both pins
    Updated main application to:
  • isolated PS/2 code into a pstransceiver file to share between keyboard and mouse
  • treat multi-byte messages as single unit for resends

@hoffman373
Copy link
Author

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
Copy link
Owner

No0ne commented Jan 28, 2023

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
Copy link
Author

hoffman373 commented Jan 28, 2023 via email

@hoffman373
Copy link
Author

hoffman373 commented Jan 28, 2023 via email

@No0ne
Copy link
Owner

No0ne commented Jan 28, 2023

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
Copy link
Author

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

@No0ne No0ne merged commit 1c60a5f into No0ne:pio-testing Feb 11, 2023
@hoffman373 hoffman373 deleted the pio-update branch February 11, 2023 14:19
No0ne added a commit that referenced this pull request Aug 2, 2023
commit e6f0d15
Author: No0ne <github@exa.solar>
Date:   Wed Aug 2 20:03:00 2023 +0200

    cleanup in progress

commit 856ae27
Merge: ef0311e c59f5ef
Author: No0ne <github@exa.solar>
Date:   Sat Jul 29 16:43:49 2023 +0200

    Merge branch 'main' into pio-testing

commit ef0311e
Merge: 1c60a5f d89d0de
Author: No0ne <github@exa.solar>
Date:   Sun Jul 23 16:12:04 2023 +0200

    Merge branch 'main' into pio-testing

commit 1c60a5f
Merge: da2668d 2d70651
Author: No0ne <github@exa.solar>
Date:   Sat Feb 11 09:50:58 2023 +0100

    Merge pull request #6 from hoffman373/pio-update

    Pio Update

commit 2d70651
Author: dustin <dustin@gifthorse>
Date:   Sat Jan 28 17:06:36 2023 -0500

    Fixed documentation and removed bad comments.

commit e38f74d
Author: dustin <dustin@gifthorse>
Date:   Thu Jan 26 13:23:44 2023 -0500

    More fixes.

commit caf1789
Author: dustin <dustin@gifthorse>
Date:   Wed Jan 11 22:42:25 2023 -0500

    Working on seperating transciever logic into seperate component.

commit da2668d
Author: No0ne <github@exa.solar>
Date:   Thu Dec 22 21:00:10 2022 +0100

    send 0xaa after blinking

commit 5f96329
Author: No0ne <github@exa.solar>
Date:   Sun Dec 18 15:33:11 2022 +0100

    ready for testing

commit 9386937
Author: No0ne <github@exa.solar>
Date:   Sun Dec 18 13:36:25 2022 +0100

    pio testing nearly finished

commit da06c6d
Author: No0ne <github@exa.solar>
Date:   Sat Dec 17 22:42:30 2022 +0100

    mouse testing

commit d1967ee
Author: No0ne <github@exa.solar>
Date:   Sat Dec 17 22:19:50 2022 +0100

    combine send & receive state machines

commit 9d92c3d
Author: No0ne <github@exa.solar>
Date:   Sat Dec 17 21:11:14 2022 +0100

    receive timing captured from real keyboard

commit 598a251
Author: No0ne <github@exa.solar>
Date:   Wed Dec 14 22:23:38 2022 +0100

    NuXTv2 working

commit 080d48c
Author: No0ne <github@exa.solar>
Date:   Wed Dec 14 20:13:02 2022 +0100

    works on P3B-F

commit a55f97f
Author: No0ne <github@exa.solar>
Date:   Tue Dec 13 23:08:29 2022 +0100

    still something broken

commit 400a300
Author: No0ne <github@exa.solar>
Date:   Sun Dec 11 22:19:47 2022 +0100

    split send & receive state machines

commit 0da861e
Author: No0ne <github@exa.solar>
Date:   Wed Dec 7 23:21:29 2022 +0100

    PIOs tested successfully

commit 6a226c0
Author: No0ne <github@exa.solar>
Date:   Sun Dec 4 21:47:45 2022 +0100

    transmitting via pio

commit 499d835
Author: No0ne <github@exa.solar>
Date:   Sun Nov 13 10:46:41 2022 +0100

    develop sdk

commit 77970a6
Author: No0ne <github@exa.solar>
Date:   Sun Nov 13 10:46:11 2022 +0100

    ps2ports.pio

commit 073a625
Merge: 32deb30 50c6730
Author: No0ne <github@exa.solar>
Date:   Sat Nov 12 19:51:20 2022 +0100

    Merge branch 'main' into pio-testing

commit 32deb30
Merge: 4694c0f aa44e0b
Author: No0ne <github@exa.solar>
Date:   Thu Nov 10 18:45:03 2022 +0100

    Merge branch 'main' into pio-testing

commit 4694c0f
Merge: 15b4496 3ba61a5
Author: No0ne <github@exa.solar>
Date:   Sat Sep 10 07:44:43 2022 +0200

    Merge branch 'main' into pio-testing

commit 15b4496
Author: No0ne <github@exa.solar>
Date:   Sat Sep 10 07:38:15 2022 +0200

    blink test
@No0ne
Copy link
Owner

No0ne commented Aug 7, 2023

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

@hoffman373
Copy link
Author

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

@hoffman373
Copy link
Author

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
Copy link
Owner

No0ne commented Aug 16, 2023

Thanks, understood!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants