There is a problem in reading the beginning of the fault register timing. If the program is written according to the manual timing, the data can not be read correctly. The following is the program that can read the fault register correctly. The comment of the code is in question.
Question 1: if you do not add CLK high and CLK low, the data read is wrong, but the manual sequence diagram does not need this operation;
Question 2: CLK_ H();//? According to the datasheet sequence diagram, the_ After H; do not read error after swap.
CLK_H();//?According to the datasheet sequence diagram, this operation is not required
CLK_L();//?According to the datasheet sequence diagram, this operation is not required
CLK_H();
LATCH_H();
CLK_L();
LATCH_L();
CLK_H();//?According to the datasheet sequence diagram, it should be after latch high;
LATCH_H();