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

UART over IR LEDs #55

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

UART over IR LEDs #55

wants to merge 3 commits into from

Conversation

Wolfvak
Copy link
Member

@Wolfvak Wolfvak commented Jun 11, 2021

this PR should fix the serial hardware situation so that a pure uart signal (idle high, 8 bits, no parity, start and stop bits) is transmitted over the infrared LEDs

  • fixes the sc16is7xx drivers so that everything is initialized properly, not sure if this should also go in mainline ASAP
  • the PWDOWN pin is properly set low so that data can come through. according to the spec sheet, when not idle it consumes 90uA and on idle it's 0.01uA, at this scale I considered it "okay" to just keep the thing on at all times
  • other pins are properly set on power on and don't need to be changed at all

unfortunately this setup requires somewhat non standard hardware on the other side - most infrared transceivers respect IrDA but we don't (we're too cool for that), so the TX and RX LEDs need to be directly connected to something that can understand serial and doesn't try to perform any conversions

the above paragraph is all "in theory", as the hardware hasn't been built yet by me but we've confirmed that the TX LED does come on in the 3DS when transmitting data via microcom (/dev/ttySC0, 115200)

when the hardware is built and we have better descriptions/schematics, this'll be merged

thanks to @al3x10m for helping out the last few days by testing and gutting his IR daughterboard

vanilla sc16is7xx driver has a bug where it registers the gpiochip _before_ setting up data needed by the gpio functions themselves
usually this doesn't cause issues because everything will be set up properly by the time the driver finishes loading, but if there's a child gpio hog node present it'll try to add it and immediately access uninitialized memory, leading to a kernel panic

this should also be fixed in mainline
eventually a better driver will need to be written to handle the PWDOWN pin during low power states
thanks to @al3x10m for all the testing and help
@Wolfvak Wolfvak added the enhancement New feature or request label Jun 11, 2021
@Maccraft123
Copy link

I've made such an adapter out of the original ROHM IC, and wired the irda tx/rx lines to an off-the-shelf 3v3 UART adapter and I can't see anything in its output while tuned in at 115200 baud rate. And as for wiring - I connected the RC TX and power down signals to 0v via 2k resistors, added a salvaged-from-3ds 3.3 resistor between VccLed and Vcc, and there are 2 caps on 3v3 power line to filter out any noise.

When I look at that IR diode stuff with my phone's camera I can see it's blinking all the time, which I don't see on my New 3DS. Might be because it's not powered off with power disable signal and on 3DS it is.

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

Successfully merging this pull request may close these issues.

2 participants