This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28377D: PWM reading GLDCTL.bit.GLDMODE : two consecutive read differnet values

Part Number: TMS320F28377D


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