Hallo,
ich hab es nun fertig gebracht, einen funktionsfähigen Brenner zu bauen (manche erinnern sich vielleicht ^^) und bin nun dabei, Assembler zu lernen. So weit so gut. Ich hab ein nettes Tutorial gefunden, verstehe alles, und es soll was blinken. Tut es aber nicht, es leuchtet nur dauerhaft.
Nach dem Gruß folgt das komplette Programm (sieht mangels Tabstops leider sehr hässlich aus). Sieht jemand den Fehler? Ich glaube, dass er irgendwie mit der Schleife zusammenhängt, denn bis zum ersten Aufruf der Subroutine kann ich die LED auf dem gleichen Weg, wie ich sie angemacht habe, auch wieder abschalten - danach funktioniert das nicht mehr.
Laut Tutorial soll da 255 Mal von 255 bis 0 runtergezählt und dann die LED umgeschaltet werden. Wie diese Schleife funktioniert ist mir ohnehin nicht ganz klar - wer setzt die 0 wieder auf 255 zurück? Mit einem Taster an Port A kann man die Frequenz halbieren, das ist aber erstmal unwichtig, denn solange nichts blinkt, hab ich davon nix.
Danke schonmal allen, die sich überhaupt die Zeit nehmen, das alles anzusehen 
mfg
MB
;*****Set up the Constants****
STATUS equ 03h ;Address of the STATUS register
TRISB equ 86h ;Address of the tristate register for port A
PORTB equ 06h ;Address of Port A
TRISA equ 85h ;Address of the tristate register for port A
PORTA equ 05h ;Address of Port A
COUNT1 equ 08h ;First counter for our delay loops
COUNT2 equ 09h ;Second counter for our delay loops
;****Set up the port****
bsf STATUS,5 ;Switch to Bank 1
movlw b’00000000’ ;Set the Port B pins
movwf TRISB ;to output.
movlw b’11110000’ ;Set the Port A pins:
movwf TRISA ;bit 1 to output, bit 0 to input.
bcf STATUS,5 ;Switch back to Bank 0
;****Turn the LED on****
Start movlw b’00100000’ ;Turn the LED on by first putting
movwf PORTB ;it into the w register and then
;on the port
;****Start of the delay loop 1****
call Delay
btfsc PORTA,0
call Delay
;****Delay finished, now turn the LED off****
movlw b’00000001’ ;Turn the LED off by first putting
movwf PORTB ;it into the w register and then on
;the port
;****Add another delay****
call Delay
btfsc PORTA,0
call Delay
;****Now go back to the start of the program
goto Start ;go back to Start and turn LED
;on again
;****Here is our Subroutine
Delay
Loop1 decfsz COUNT1,1 ;This second loop keeps the LED
goto Loop1 ;turned off long enough for us to
decfsz COUNT2,1 ;see it turned off
goto Loop1
return
;****End of the program****
end ;Needed by some compilers,
;and also just in case we miss
;the goto instruction.