my msp 430 works on 4Mhz . What will be the instruction cycles timing to execute Port setting Like P1OUT=0x01,P1OUT&=~(0x01)
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.
my msp 430 works on 4Mhz . What will be the instruction cycles timing to execute Port setting Like P1OUT=0x01,P1OUT&=~(0x01)
On the MSP430, all device registers are memory-mapped, and are accessed like 'normal' memory.
Most devices, including the digital I/Os, can be accessed without any wait states.
A single read-modify-write instruction needs five MCLK cycles; you can save one cycle but not reading the old value, and one cycle by using a constant value of 1/2/4/8/-1.
So "P1OUT=0x01" needs three cycles, and "P1OUT&=~(0x01)", five.
What are you trying to achieve? Outputting a signal with a specific frequency could be done more easily and realiably with a timer.
**Attention** This is a public forum