AlfredJingle
Posts: 62
Joined: Thu Mar 03, 2016 10:43 pm

problem switching on i2c0 - any ideas?

Sat Jan 06, 2018 4:13 pm

Hi,

Has anybody here had succes with the switching on of the bsc0 controller on a Raspberry 3 in assembly?


On my OS-free baremetal system in Arch32, I want to use i2c0 on pins 27 and 28 and I fail miserably. I have no problem setting up the bsc1 controller (sda1 and scl1 on pins 3 and 5) and contacting and sending/receiving data with various i2c slaves via those pins. But if I try to set up the bsc0 controller it does not want to listen. I cannot change the i2c address (it stays on 0x46) and has very strange settings for time-out and delays (but these can be changed). And if I try to config pins 27 and 28 the system craches.

Any ideas? Am I really condemned to only 1 i2c controller?
going from a 6502 on an Oric-1 to an ARMv8 is quite a big step...

AlfredJingle
Posts: 62
Joined: Thu Mar 03, 2016 10:43 pm

Re: problem switching on i2c0 - any ideas?

Sun Jan 07, 2018 1:19 pm

Ooh never mind,

I found the answer in these forums: i2c0 has been confiscated by the Raspberry Organisation somewhere in 2014. First to read an identifying eeprom during boot. This would have allowed to free ic20 after boot if no eeprom was found. But on the rPi3 it is also used for lots of other functions and thus is permanently lost. Which to me feels like a bit of an unfair action, as they already confiscated bsc2 (ie i2c2) for internal use.

Conclusion: the rPi3 has 3, buggy, i2c controllers of which only 1 is available to the user. The good news is that pins 27 and 28 can be switched to normal i/o without crashing, and thus used for bit-banged i2c.

Next step: write such a bit-banged i2c interface, in Forth. Life is getting better by the day!
going from a 6502 on an Oric-1 to an ARMv8 is quite a big step...

Return to “Bare metal”

Who is online

Users browsing this forum: No registered users and 1 guest