| Newsgroups |
gmane.comp.hardware.texas-instruments.msp430.discuss |
| Message-ID |
<[email protected]> |
Yes, the xor.b is encoded as two words (E3D2 0021) and this is consistent with Table 3-16 (to partially answer Jon's question)
Addressing Mode Length of
Src Dst No. of Cycles Length of Instruction Example
Rn &EDE 4 2 MOV R5,&EDE
versus
#N &EDE 5 3 ADD #33,&EDE
And to further address Jon's question the Family Guide has a list of advantages for using the constant generators:
The constant generator advantages are:
• No special instructions required
• No additional code word for the six constants
• No code memory access required to retrieve the constant
The last one implies saving a cycle although it does not explicitly say so.
But, Jon's SLAA024 has this:
If the interrupt is requested during the low power modes 3 or 4, then additional two cycles are needed.
So that counts for 2 of the 4 missing cycles although it gives no further explanation. It would be easy to try the other low power modes and see what happens. The LED reference signal could also help determine when those 2 extra cycles happen.
Concerning stopping the process after the RETI, not clearing the low-power bits inside the ISR would do that.
So, I have a couple of things to try and a new (to me) document to read. I'll report back when I have some more details.
Thanks both of you for the help and pointers.
Emmett Redd Ph.D. mailto:[email protected]
Professor (417)836-5221
Department of Physics, Astronomy, and Materials Science
Missouri State University Fax (417)836-6226
901 SOUTH NATIONAL Lab (417)836-3770
SPRINGFIELD, MO 65897 USA Dept (417)836-5131
In statesmanship get the formalities right, never mind about the moralities. -- Mark Twain.
________________________________
From: [email protected] [[email protected]]
Sent: Thursday, September 17, 2015 10:32 PM
To: [email protected]
Subject: Re: [msp430] Cycle Counting--Too Many
How is the xor.b #01,&p1out encoded? It would still potentially disassemble correctly if it didn't use the register for the #01, but would then require 3 words. As Jon says, that would still only recover 1 clock for you. I haven't tried this myself, so don't know what else might be added but can you stop the process after the reti.? A break on the xor.b might change the behaviour, if so, perhaps move the LPM3 start instruction there and see what happens.
Al
On 18/09/2015 4:57 AM, 'Redd, Emmett R' [email protected]<mailto:[email protected]> [msp430] wrote:
I am using Tom Baugh's MSP430F2274 board and software in a class. We are also using IAR Kickstart.
In his second lab exercise, BetterNextProject, we see various timing interrupt methods and LPM3 to reduce the number of cycles and power consumed. Each time the LED output, P1.0, toggles due to a timer firing its interrupt, the SMCLK can be seen making a burst of 28 cycles of running in active mode. Analyzing the disassembly code and reading the Family User's Guide, I can only account for 24 cycles.
Here are the details:
Action/Instruction (in execution order) Cycles (from Tables 3-14 & 16 in the Family User's Guide)
Interrupt Accepted 6
008094 bic.w #0xF0, 0x0(SP) 5 // First line of WatchdogTimer_ISR. All low-power modes cleared.
00809A reti 5
008050 xor.b #0x1,&P1OUT 4 // Constant Generator register source to absolute destination.
// This toggles the LED.
008054 jmp 0x804C 2 // End of While Loop.
00804C bis.w #0xD8,SR 2 // Beginning of While Loop. Start LPM3. Instruction immediately
___ //before the XOR.
Total 24 cycles
When I monitor SMCLK on P2.1 on an oscilloscope, it idles high and has 28 falling edges. In addition, the LED toggles on the 22nd falling edge.
I count 24 cycles in the code, but measure 28 on the oscilloscope. (And I count 20 until the end of the instruction toggling the LED but measure it occurring on the 22nd falling edge.
So, what am I missing?
Thanks,
Emmett Redd Ph.D. mailto:[email protected]
Professor (417)836-5221
Department of Physics, Astronomy, and Materials Science
Missouri State University Fax (417)836-6226
901 SOUTH NATIONAL Lab (417)836-3770
SPRINGFIELD, MO 65897 USA Dept (417)836-5131
In statesmanship get the formalities right, never mind about the moralities. -- Mark Twain.
------------------------------------
Posted by: "Redd, Emmett R" <[email protected]><mailto:[email protected]>
------------------------------------
To unsubscribe from the msp430 group, send an email to:
[email protected]<mailto:[email protected]>
------------------------------------
Yahoo Groups Links