I am in the process of debugging some firmware for a solenoid driver board using a pair of PT2000 solenoid controllers.
There are three registers in PT2000 design studio, meas_func1 - meas_func3 @ 19Ah-19Ch, which do not appear in the data sheet.
I started the project by copying the project for the demo board, wiped the code and put in my own firmware. On Channel3 Microcore0 I am using current sense block 6 to test if current starts flowing in the solenoid, and set an upper limit (this is for a solenoid being driven via voltage drive).
Permissions are set for CH3UC0 to have access to current block 6..
stadc off RIGHT_OC_TARGET; * (RIGHT_OC_TARGET = ossc)
stgn gain19.25 RIGHT_OC_TARGET;
dfcsct DFCSCT_RIGHT; * use right side bridge current measurement (DFCSCT_RIGHT = dac6l)
load I_CURRENT_DETECT RIGHT_DAC_TARGET _ofs; * (RIGHT_DAC_TARGET = dac_ossc)
cwer STATE_VOLTAGE_DRIVE ocur row2; *I_COMP==1 (current detected)
wait row123; * FIRST WAIT STATEMENT.
* (The other wait entries are for START==0 (to terminate activation) and a
* a 7ms timeout to declare a fault if I don't see current.)
... <snip> (jr2 points to overcurrent fault routine)
load I_OVERCURRENT RIGHT_DAC_TARGET _ofs; * change I_COMP for overcurrent level
cwef jr2 ocur row2; *I_COMP==1 (overcurrent detected)
wait row12; * SECOND WAIT STATEMENT
* (Here the other row is just for START==0 to terminate the drive.)
At the first wait statement, row2 is taken once solenoid current (75ma) is detected.
I then load in a 5.5A overcurrent limit, but the second wait immediately is taken and goes to the overcurrent fault error state. Oscope/hall effect current probe on solenoid wires show no appreciable current.
I checked all the register settings, but had no description of the three mystery registers, which had settings still there from the original demo board project. I went ahead and zeroed them out, recompiled... and suddenly it is operating as expected.
Why does the datasheet not have any description of these registers? I need to know what they do so I can make sure that they are set correctly, as they are obviously affecting operation.
It should be noted that at this time I have autodiagnostic faults disabled (endiaga diagoff;)as I haven't gotten to shaking down the problems in my configurations for it).