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

Non-standard pinmux for i2c1 #16

Open
asymingt opened this issue Jan 24, 2019 · 3 comments
Open

Non-standard pinmux for i2c1 #16

asymingt opened this issue Jan 24, 2019 · 3 comments

Comments

@asymingt
Copy link

Hi @avafinger

I'd like to modify the device tree to pinmux a few things differently out the 40-pin expansion header. I'd like to mux i2c1 SCL and SDA to pins 11 and 12 respectively, while keeping uart3 working with software flow control using TX and RX on pins 8 and 10. Firstly, is this possible?

Using this link as a reference, I changed the following block in the device tree, under the assumption that the pin ordering is "SCL", "SDA" based on the pattern used in i2c0:

 i2c1 {
  pins = "PA1", "PA16";
  function = "i2c1";
  phandle = <0x22>;
};

I then deleted this block to force software flow control:

uart3_rts_cts {
  pins = "PA15", "PA16";
  function = "uart3";
};

I then tried to run sudo i2cdetect -y 1 but the scan takes a very long time. Presumably, I have overlooked something here. Perhaps I need to update the uart3 block or interrupt field of the i2c1 block. Any help would be greatly appreciated.

@asymingt
Copy link
Author

I think I might have an answer to my own question. It appears as if each pin only supports a certain number of functions, so I cannot just arbitrarily route SDA and SCL to a specific pin.

@avafinger
Copy link
Owner

I think SDA and SCL are routed physically to Pin3 and Pin5 respectively.
Pin12 you could choose one of these: UART3-CTS or EINT16 or SPI1-MISO

@StuartIanNaylor
Copy link

StuartIanNaylor commented Feb 26, 2019

Would it not just cause confusion to move from the standard 3/5 pi0 pins?
PS its fantastic to see a v4 kernel would you say v9 is the stable stable :)

Stuart

PS only just found the repo so let me catch up but also have an I2C device to test.
[EDIT]

I gave up guys great you have got so far but this like many others when at 1080p the screen jumps and flickers like hell.
Tried loads of images now always the same and it was worth a punt as like the form factor but very much a typical bananapi.

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

3 participants