Hello everybody ,
I um using PWM and from time to time needing to force them low , read all values eventually do some modification and then get them back working .
now I found issues due to "unexepcted values" in particular in GLDCTL.bit.GLDMODE.
digging in the issue I found that two consecutive reading of this register were giving me 2 different results ( both in debug and in real time functioning ) :
this is the code I used to do double reading :
read1 = PWM_REGS(PHASE_U)->GLDCTL.bit.GLDMODE;
read2 = PWM_REGS(PHASE_U)->GLDCTL.bit.GLDMODE;
I tried also to put same delays in between ( up to microseconds ) and again same issue .
please where am I wrong ? what would you reccomend ?
thank you very much
regards
Carlo