cancel
Showing results for 
Search instead for 
Did you mean: 

STPM32 period measurement issue

AThom.10
Associate
Hi.
I try to implement STPM32 into my project for the purpose of some voltage measurement.
When I tried to get period measurement value and status I encountered strange behavior:
1). If I read Period Value register (address 0x2E, row 23) I get period value in the "PH2 Period" field instead of "PH1 Period". I connected laboratory power supply to the STPM32 inputs and got correct period value that tracked power supply frequency when I changed it. I got values 0x09C40682/0x09C40821/0x09C40AD8 for 75/60/45Hz
2). The status register DSP_SR1 (address 0x20) always hold Period Error status bit (bit 25). No matter what frequency is applied to the inputs this bit is appear in the register.  As I checked further there is no SIG or SWELL events that might affect this matter (SR1 value 0x0207700C). Furthermore if I read DSP_EV1 register I get no period error in this register when I apply voltage in the measurement range frequency.  When I apply voltage with out of range frequency I get period error in the event register as expected.  Despite the fact that some time I got wrong period error state from the event register, mostly it shows normal behaviour.
 
I made reset sequence at the start and wrote Auto-Latch Bit in the DSP_CR3 register. Just In case I tried to latch throw SYN/SCS pins and disable digital front end for secondary channel but that had no effect to this problem.
 
Is it normal behaviour for this IC ?
What can you suggest me to do to measure the period value correctly and check if there is any out of range condition?
0 REPLIES 0