Hi Friends,
I am using MSP430F5529LP and default DCO of 1.048576 MHz clock.I am not getting 1ms delay for 1000 counts(i.e accurate 954 counts) instead i am getting 10ms and i attached my code also,please help guys.
Thanks in advance
Beeresh
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 Friends,
I am using MSP430F5529LP and default DCO of 1.048576 MHz clock.I am not getting 1ms delay for 1000 counts(i.e accurate 954 counts) instead i am getting 10ms and i attached my code also,please help guys.
Thanks in advance
Beeresh
If you want to ensure a clear delay you may include a short piece of assembler code that may look like this (I do most of my time-critical work in asm):
push.w R15 // Save R15, 2 cycles
mov #[Value],R15 // For values 1, 2, 4, 8, 0xFFFF this takes 2 cycles, otherwise 3.
Loop: dec R15 // 1 cycle
jnz Loop // 2 cycles
pop.w R15 // Restore R15, 2 cycles
This means a total of (2+2+2+3*Value)=(6+3*Value) or (2+2+3+3*Value)=(7+3*Value)
**Attention** This is a public forum