Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

KEIL asm program error

Status
Not open for further replies.

Gastonio

New Member
Hello, I am having problem with program written with KEIL: *** error 65: access violation at I:0x81 : no 'write' permission. Can't find sollution myself, could you help?
This program takes info from ADC and writes it to RAM (100 samples). These is also delay routine with a 10x10ms=100ms.

ADC is AD573, processor - 8051.

RAM equ 0000H
ADC_CONV equ 4000H
ADC_READ_HBE equ 8000H
ADC_READ_LBE equ 0C000H
ADC_NIN equ 100
TIMER_MULTIP equ 10

ORG 0000H
SJMP MAIN
ORG 0040H

MAIN: MOV R1, #ADC_NIN
WAIT1: MOV DPTR, #ADC_CONV
MOVX @DPTR, A

WAIT2: JNB P3.2, WAIT2

LCALL READ

READ: MOV DPTR, #ADC_READ_HBE
MOVX A, @DPTR
MOV DPTR, #RAM
MOVX @DPTR, A
INC DPTR
MOV R2, DPH
MOV R3, DPL

MOV DPTR, #ADC_READ_LBE
MOVX A, @DPTR
ANL A, #0C0H
MOV DPH, R2
MOV DPL, R3
MOVX @DPTR, A
INC DPTR
MOV R2, DPH
MOV R3, DPL

LCALL DELAY

WAIT3: DJNZ R1, WAIT1

RET

DELAY: MOV TMOD,#01
MOV R0,#TIMER_MULTIP

WAIT4: MOV TH0,#0D8H
MOV TL0,#0EFH

SETB TR0

FLAG: JNB TF0, FLAG

CLR TR0
CLR TF0
DJNZ R0, WAIT4
RET

END
 
Last edited:
Well, maybe you could justl tell if I had explained the problem correctly or no.
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top