Hi, Just a question about _nop_() ! I work on ST10F168 at 24MHz. How can i know what's the delay of _nop_() function ??? Thanks in advance Regards
If it's the same as in C51, it's not a real function - it just causes the compiler to insert a sinlge NOP instruction. Check in your C166 Manual. You can find the "delay" of a sinlge NOP instruction by reference to your ST10F168 instruction set Documentation.
At 24 MHz, the CPU cycle is 41+2/3 ns. Instruction execution time is at least 2 CPU cycles for the C166 CPU. The NOP instruction is executed in 2 CPU cycles, that is 83+1/3 ns. Of course, you have to take into account interrupts, CPU pipeline effects from the previous instructions and so on. I have used the ST10F168 microcontroller quite a bit, and I have checked those times carefully with long loops and a stopwatch, so you can rely on them :-) Regards, - mike
I have checked those times carefully with... a stopwatch I'd second the results, but the nanosecond hand on my stopwatch broke off, and I haven't bought a new one.
Thanks Mike, that comes to confirm what I thought ! Best regards