RobertK66 / obc_1769_core

Implements hardware abstractions and Layer2(3) modules for usage of the OBC hardware in cubesat projects
GNU General Public License v3.0
1 stars 1 forks source link

Configure, check and test all 3 I2C buses on EM2 #24

Closed RobertK66 closed 2 years ago

RobertK66 commented 2 years ago

also see discussions here: #23

kodsurf commented 2 years ago

With a code commit :

https://github.com/RobertK66/obc_1769_core/commit/6231abd36073e861503235f9ec31631412e3558e

I am able to transmit message over I2C from OBC to Arduino image

Amount of bytes received by arduino is always correct (when changing "read_request" length)

However received bytes are wrong.

kodsurf commented 2 years ago

During initialization of LPC_I2C

image

I enabled switches

which should activate LPC_I2C2 on A and B sides image

image

Then I checked pinning_climb.h image

All those switches are by default initialized with HIGH value.

Meaning that all switches are enabled by default ?

However the strange thing that I noticed :

image

If I manually set those switches to LOW - I2C still works (with wrong bytes)

RobertK66 commented 2 years ago

Maybe the clock pulses are not compleetly 'cut off' by the Switch ICs!?

Primary goal of this EN pins is to get rid of short circuited pins in SP connectors. I am not sure, why you see your behaviour. Maybe we have to define a better test case for this "saftey feature". To make funvtional tests just have all EN pins initilaized to High and connect to any of the buses.....

Remark: You can easily test all Enable Pins with my hw_check command:

| 'h' | \<pinIdx> \<mode> | sets an GPIO pin to mode (0: initVal, 1: high, 2: low, 3: slow blink, 4: fast osz.)  |

The Pin Idx for the 4 I2C EN pins are:

PINIDX_I2C_A_EN  31
PINIDX_I2C_D_EN  32
PINIDX_I2C_C_EN  33
PINIDX_I2C_B_EN  42
kodsurf commented 2 years ago

After latest remark regarding enabling C/D in pinning_climbobc.h :

I2C works correctly on every sidepanel.

Switches also work as expected.