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
  • Here's the assembler file:

    :020000020000FC
    :0E014A00E6E3C0007FE2CC007EE2CC000DFBBD
    :10000400A55AA5A5D180E6120C000A86FFCD1A8652
    :1000140006D61A8903FB0A89FF44E6F10070F6F15B
    :10002400E0F1D190E6E80005E6E80004E60C0810EB
    :10003400E68ACD06E60D0820E68BC904E60A0CFA2A
    :10004400E6000000E6010100E6020300E60800FC09
    :10005400B54AB5B5E6F00090E6F90000E6F8000010
    :10006400F01870192D29E005DC0998282D25F032A7
    :10007400DC099848AAF21BE0AAF20EF0F0347C33B3
    :100084000EF306F300FDE0154C549150685BB85331
    :10009400084128213DF30DE7DC099838DC44B9A375
    :1000A4000831184076F300C028217DF80DDCB9A48E
    :1000B400084128217DFC0DD7E6F90100E6F800800F
    :1000C400E6030300DC09A8282D3C08821890AAF254
    :1000D40029F0F04266F2FF3F3D05E004DC09A82860
    :1000E40008821890DC09A838088218908AF406E07F
    :1000F400F6F306FEDC09A83808821890DC09A9A8E2
    :1001040008811890B9A308318AF406E08AF304E060
    :100114000603010076F300C028213DF09AF8D000D0
    :1001240008810DCEC0435C1376F300FDE014F1A505
    :100134004C458AF203709140684B0D01784BB843EB
    :060144000DBFFA004A01A4
    :020000021000EC
    :0280000000007E
    :020000020000FC
    :04000000FA000400FE
    :00000001FF
    

Reply
  • Here's the assembler file:

    :020000020000FC
    :0E014A00E6E3C0007FE2CC007EE2CC000DFBBD
    :10000400A55AA5A5D180E6120C000A86FFCD1A8652
    :1000140006D61A8903FB0A89FF44E6F10070F6F15B
    :10002400E0F1D190E6E80005E6E80004E60C0810EB
    :10003400E68ACD06E60D0820E68BC904E60A0CFA2A
    :10004400E6000000E6010100E6020300E60800FC09
    :10005400B54AB5B5E6F00090E6F90000E6F8000010
    :10006400F01870192D29E005DC0998282D25F032A7
    :10007400DC099848AAF21BE0AAF20EF0F0347C33B3
    :100084000EF306F300FDE0154C549150685BB85331
    :10009400084128213DF30DE7DC099838DC44B9A375
    :1000A4000831184076F300C028217DF80DDCB9A48E
    :1000B400084128217DFC0DD7E6F90100E6F800800F
    :1000C400E6030300DC09A8282D3C08821890AAF254
    :1000D40029F0F04266F2FF3F3D05E004DC09A82860
    :1000E40008821890DC09A838088218908AF406E07F
    :1000F400F6F306FEDC09A83808821890DC09A9A8E2
    :1001040008811890B9A308318AF406E08AF304E060
    :100114000603010076F300C028213DF09AF8D000D0
    :1001240008810DCEC0435C1376F300FDE014F1A505
    :100134004C458AF203709140684B0D01784BB843EB
    :060144000DBFFA004A01A4
    :020000021000EC
    :0280000000007E
    :020000020000FC
    :04000000FA000400FE
    :00000001FF
    

Children
No data