This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

_nop_() does not work

Hi forum!
I need a delay in a programm but _nop_() seems not to work. Thus I wrote the following code in the main function where x is an IO pin:

while(1)
{
x = 1;
_nop_();
x = 0;
_nop_();
}

Only the second _nop_() causes a delay but not the first one. µVsioin2 is used. Can anybody help me?

Thanks Fabian

Parents
  • I'm really sorry guys, but I still don't understand what I'm doing wrong.

    Because you insist on programming the chip without taking the time to understand the chip.

    If you have no idea of the chips architecture, how in the world do you expect to be able to calculate a delay.

    C is wonderful, but (especially in the embedded world) it does not release you from understanding what you are working with.

    Erik

Reply
  • I'm really sorry guys, but I still don't understand what I'm doing wrong.

    Because you insist on programming the chip without taking the time to understand the chip.

    If you have no idea of the chips architecture, how in the world do you expect to be able to calculate a delay.

    C is wonderful, but (especially in the embedded world) it does not release you from understanding what you are working with.

    Erik

Children
No data