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

Using a logic level converter instead voltage dividers and transistors #2

Open
knifesk opened this issue Feb 20, 2024 · 1 comment
Open

Comments

@knifesk
Copy link

knifesk commented Feb 20, 2024

TLDR: If you're using a Logic level converter instead of a transistor, set INVERT_OUTPUTS in GenesisController.h to false;

Hi! firstly, this is more like a contribution than an Issue.

Instead of using a lot of resistors and a transistor I used an 8 channel logic level converter, more specifically the TXS0108E. Mostly because I don't have the right resistors values (nor the required amount) and I already owned the LLC.

I just wired up the same GPIOs on the Pi to the A side and the DB9 pins to the B side of the converter. Wired the 3.3V to VA and the 5v to VB and GND to GND. Also wired a second connection from the 5v to the PIN5 in the DB9.

It was supposed to work right out of the box, but it didn't, well.. most of it worked, but no quite right.. UP, DOWN, Start, A, B and C were working, but not the XYZ and Mode buttons and the LEFT and RIGHT buttons registered as pressed all the time... So I wired everything into my logic analyzer and noticed the problem after digging a couple hours through the code... The Select pin was being pulled LOW when it was supposed to be HIGH and vice-versa. Of course it would, as you're pulling the PIN7 high with a Pull-up resistor and setting the GPIO to HIGH to make the PIN7 go LOW. This was my problem, then I found the "// An NPN is used which inverts the output" comment.. so I set that to false and BOOM! it worked just fine! :D

Thanks for the docs and code, it was really simple to follow up. Well, except the part that I had to compile the entire thing in my very old raspberry pi 2 and it took forever 😅

Cheers!

@Tails86
Copy link
Collaborator

Tails86 commented Feb 21, 2024

Ah! I'm glad you figured that out. Seems like I should make that more apparent on the README/schematic and maybe move that setting to configuration.h. I should probably compile another set for release too.

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

No branches or pull requests

2 participants