HI:
A question about instruct MOVW
According the Disassembly code, the PC of instruct MOVW is 0x082c and 0x082d.
The run cycle of MOVW is 1, why the PC is 0x082c and 0x082d.
Any suggestion? Thanks
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.
HI:
A question about instruct MOVW
According the Disassembly code, the PC of instruct MOVW is 0x082c and 0x082d.
The run cycle of MOVW is 1, why the PC is 0x082c and 0x082d.
Any suggestion? Thanks
Tobby Guo said:According the Disassembly code, the PC of instruct MOVW is 0x082c and 0x082d.
The run cycle of MOVW is 1, why the PC is 0x082c and 0x082d.
Any suggestion? Thanks
The MOVW instruction requires a 32-bit opcode. This is why it takes up 2 16-bit memory locations. The opcode is shown in the reference manual screenshot you posted.
The cycles are the number of CPU cycles the instruction takes to execute. The size of the opcode and the cycles required to execute are not the same.
Regards
Lori
Lori,
Thanks for you explaintion.
The MOVW instruction requires a 32-bit opcode, 0x082c and 0x082d is only memory location.
As the screenshot above:
Is the code read Epwm5Regs.TBCTR take up 6 16-bit memory location from 0x0828 to 0x082d and need 4 machine cycle(MOVW/MOV/MOVW/MOV) to execute?
Thanks.
Lori,
After I recheck my first screenshot picture, I confuse.
I continuous read the value of Epmw5Regs.TBCTR four times , the value of u16ISRRunTimer06/u16ISRRunTimer07/u16ISRRunTimer08/u16ISRRunTimer09 is 431/437/443/449, the value add 6 each read
In my opinion, the value of Epmw5Regs.TBCTR Increment or decrement every machine cycle.
if read Epwm5Regs.TBCTR need 4 machine cycle(MOVW/MOV/MOVW/MOV) to execute, I think the value of u16ISRRunTimer06/u16ISRRunTimer07/u16ISRRunTimer08/u16ISRRunTimer09 shoud be 431/435/439/443, the value add 4 each read.
Any suggestion? Thanks.
Tobby,
A visual inspection gives the best case scenario. There may be wait-states or pipeline stalls that were not taken into account. You can try creating a pipeline diagram or you can use the timer values. I would suggest the latter as it is much easier :)
Regards
Lori