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.

Compiler/LAUNCHXL-F28069M: Compiler/LAUNCHXL-F28069M

Part Number: LAUNCHXL-F28069M

Tool/software: TI C/C++ Compiler

Hello!

I'm currently doing LAB 7 from the C28x_Microcontroller Multi-day Workshop, and I'm having trouble understanding the influence the 'EPwmxRegs.CMPCTL' register has on the project. I've tried reading the lab outline, as well as the user manual but I can't seem to figure out what the 'SHDWxFULL' bit, 'SHDWxMODE' bit, and 'LOADxMODE' bit does. I read that 'shadowing' means to either read the actual register, or one that simply replicates the actual register. How important is it to get that bit right for a relatively slow system? I went with the way it is done in the solution program, could I just set them up that way every time?

Also, one last thing. When I try to run the the program by going "Scripts -> RealTime Emulation Control -> Run Realtime with Reset", I'm only seeing updated values in the ADC Buffers get updated when I click 'pause', this is also the only time when the graph will update. Is this right? 

Thanks!

  • Andrew,

    Your question can be answered by first understanding the meaning of 'active' and 'shadow' registers. This can be found in the F2806x TRM (spruh18g.pdf) on page 255. The active register controls the hardware and is responsible for actions that the hardware causes or invokes. The shadow register buffers or provides a temporary holding location for the active register. It has no direct effect on any control hardware. At a strategic point in time the shadow register's content is transferred to the active register. This prevents corruption or spurious operation due to the register being asynchronously modified by software. Now when reviewing the "ePWM Compare Control Register" slide in the workshop manual on page 7-12 (page 138), the LOADxMODE bit fields determine when the shadow register gets loaded to the active register, and the SHDWxMODE bit fields determine if the shadow mode is used or if the active register gets loaded immediately. The SHDWxFULL bit fields are just status bits for determining if the shadow register is full or not full. The key message here is that you would want the active register to have a new value at a known instant of time (e.g. when the CTR = 0, CTR = PRD, etc.).

    When running the lab exercise using the scripts for real-time emulation mode, you should also use the scripts to halt the code too (not the 'pause' icon). For the graph to update you must first enable continuous refresh for that window. See lab 6 on page 6-23 (page 123) to learn more about using real-time emulation mode.

    I hope this helps. If this answers your question, please click the green "Verified Answer" button. Thanks.

    - Ken