Closed kodsurf closed 1 year ago
Arduino code that sends out I2C request to PSU can be found here
https://github.com/RobertK66/obc_1769_core/blob/STP/utilities/PSU_Arduino/arduino_request_from_PSU/arduino_request_from_PSU.ino
Arduino code was provided by PSU team and Andreas Stren.
In a branch feature/psu_integration I were able to reproduce same result from OBC.
How to :
When "k" command is sent to debug UART
is executed
Within a function two i2c jobs are added
1) First one transmits single byte with starting register index at PSU datavector
it is important here to leave rx_size =0 for pure transmit .
2) For the second job which is "pure read request" we must keep tx_size and tx_data empty !
The amount of received bytes to be defined in rx_size
PSU replies with bytes starting from index that we provided and untill the last byte of datavector (86)
Here I hardcoded that we will receive 3 bytes (just for testing)
With "k"command t - PSU replies with full message. But OBC captures only 3 as we hardcoded it.
Lets wait for the inputs of @AndyFHWN here.
Arduino code that sends out I2C request to PSU can be found here
https://github.com/RobertK66/obc_1769_core/blob/STP/utilities/PSU_Arduino/arduino_request_from_PSU/arduino_request_from_PSU.ino
Arduino code was provided by PSU team and Andreas Stren.
In a branch feature/psu_integration I were able to reproduce same result from OBC.
How to :
When "k" command is sent to debug UART
is executed
Within a function two i2c jobs are added
1) First one transmits single byte with starting register index at PSU datavector
it is important here to leave rx_size =0 for pure transmit .
2) For the second job which is "pure read request" we must keep tx_size and tx_data empty !
The amount of received bytes to be defined in rx_size
PSU replies with bytes starting from index that we provided and untill the last byte of datavector (86)
Here I hardcoded that we will receive 3 bytes (just for testing)
With "k"command t - PSU replies with full message. But OBC captures only 3 as we hardcoded it.