bananapi-zero-ubuntu-base-minimal icon indicating copy to clipboard operation
bananapi-zero-ubuntu-base-minimal copied to clipboard

Non-standard pinmux for i2c1

Open asymingt opened this issue 5 years ago • 3 comments

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 avatar Jan 24 '19 04:01 asymingt

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.

asymingt avatar Jan 24 '19 16:01 asymingt

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

avafinger avatar Jan 24 '19 19:01 avafinger

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.

StuartIanNaylor avatar Feb 26 '19 13:02 StuartIanNaylor