Still struggling with CAN Bus interface to Huawei power supply - is it even possible?

Dsolberg8132

Active member
The Huawei power supply responds to request data frame with 13 data frames containing power supply values. These data frames are seperated by 3-7 ms with a total time of 49 ms. I have a standalone sketch that is sending out the request data frame, that I have tested from 1000 ms down to 1 ms, and I can decode the data frames that I want and display the data on a Nextion display. I found that if I had Serial.print statements for debugging that it would prevent the decoding of all of the data frames.

When I tried to incorporate this into a much larger LDMOS amplifier controller sketch that I no longer could decode all of the data frames. I was calling the same code that was in the standalone sketch but as a function in the amplifier controller sketch. I called this function from the loop.

The data frames that I want are the 7th and 11th data frames. I can't hold up the rest of the amplifier sketch for the 49 ms that it takes to read all of the data frames.

I am not very familiar with the CAN bus hardware and libraries. Does it buffer the data similiar to a UART or does the application need to be ready to read the data frames as they arrive. My goal was to be able to read the voltage and output current in near real time, and to change the output voltage by selecting a button on the Nextion display. Changing the voltage is easy but I am just about to give up on trying to read the voltage and current.

Am I attempting to do something that is not practical, or am I missing something?

This is what the data looks like on a CAN bus analyzer:

1744063031204.png


Don K9AQ
 
Back
Top