Electrical – Using timers 8051 Assembly Microcontroller

8051assemblymicrocontroller

I am testing a basic timer example in keil (8051 )
when I debug this code

org 0
MOV TH0,#76
MOV TL0,#01
MOV TMOD,#01
SETB TR0
JNB TF0,$
end

I get the error

    error 65 access violation at c: 0x000e no execute read permission

Please I need help to solve this problem

Best Answer

You have a classical mistake here. You have made no provisions as to what your program should be executing after you get to address 0x000E.

Here take a look:

C:0x0000    758C4C   MOV      TH0(0x8C),#0x4C
C:0x0003    758A01   MOV      TL0(0x8A),#0x01
C:0x0006    758901   MOV      TMOD(0x89),#0x01
C:0x0009    D28C     SETB     TR0(0x88.4)
C:0x000B    308DFD   JNB      TF0(0x88.5),C:000B
C:0x000E    ????     ???      ??? ???

Just because you put an "end" statement in your assembly language source code means nothing to the run time 8051 core trying to fetch instructions.

Related Topic