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
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