Hallo
@ Mobius
Deine Routine funktioniert hab sie mal geschrieben um sie fuer meine Anwedung zu testen.
Code:
list p=16f873 ; list directive to define processor
#include <p16f873.inc> ; processor specific variable definitions
__CONFIG _CP_OFF & _WDT_ON & _BODEN_ON & _PWRTE_ON & _RC_OSC & _WRT_ENABLE_ON & _LVP_ON & _CPD_OFF
; '__CONFIG' directive is used to embed configuration data within .asm file.
; The lables following the directive are located in the respective .inc file.
; See respective data sheet for additional information on configuration word.
;***** VARIABLE DEFINITIONS
w_temp EQU 0x20 ; variable used for context saving
status_temp EQU 0x21 ; variable used for context saving
AD1 EQU 0x22
AD2 EQU 0x23
DA10 EQU 0x26
DA11 EQU 0x27
PIX_COUNT EQU 0x2F
TEST_PORTA EQU 0x30
TEST_PORTB EQU 0x31
;**********************************************************************
ORG 0x000 ; processor reset vector
clrf PCLATH ; ensure page bits are cleared
goto main ; go to beginning of program
;Initialisierung
ini
movlw 0x6F
movwf DA10
movlw 0x1C
movwf DA11
return
main
call ini
;Die Routine ist nur zum Test geschrieben ist nicht die eigenliche Routine
;ansonsten laesst sich sowas auch einfacher schreiben
start
incf PIX_COUNT
movf PIX_COUNT,w
addlw 0x21
movwf FSR
movlw 0x26
movwf INDF
movf PIX_COUNT,w
addlw 0x21
movwf FSR
movf INDF,w
movwf FSR
movf INDF,w
movwf TEST_PORTA
incf FSR
movf INDF,w
movwf TEST_PORTB
nop
nop
nop
END ; directive 'end of program'
Nochmal Danke
Lesezeichen