hier mal ein Quellcodebeispiel von mir...
hab das ganze doch noch mal rausgekramt und noch mal mit mplab simuliert. Hab dazu das projekt als buildoptions/release noch einmal neu erstellt (Build All) dann kann man einfach mit F7 Zeile für zeile den code durchsimulieren...Code:list p=16f505 #include <P16f505.INC> ; Configuration festlegen: ; Power up Timer, kein Watchdog, int-Oscillator, kein Brown out __CONFIG _MCLRE_OFF & _CP_OFF & _WDT_OFF & _IntRC_OSC_RB4EN ; Variablennamen vergeben loop1 Equ 0x08 ; Zähler für Warteschleife loop2 Equ 0x09 ; Zähler für Warteschleife time Equ 0x10 ; Zeitvorgabe für pause wert in 0,1 sek wertb Equ 0x1A wertc Equ 0x1B anz Equ 0x0A zeit Equ D'15' ;initialisieren der ports movlw B'11011111' option movlw B'00001000' ; PortB bis auf RB3 output TRIS PORTB movlw B'00001000' ; PortC bis auf RC3 output TRIS PORTC movlw B'00111111' ; alle ausgänge portb an movwf PORTB movlw B'00111111' ; alle ausgänge portc an movwf PORTC ;Hauptprogramm movlw zeit movwf time call pause movlw 0x00 movwf PORTB movlw zeit movwf time call pause start movlw 0x0A movwf anz main movlw 0x00 movwf PORTC movlw 0xFF movwf PORTB movlw zeit movwf time call pause . . . usw...
Was heist denn in der schaltung wird nichts in PORTB geladen? Wie brennst du denn die PICs und sind alle register (SFR) richtig gesetzt?
Zum simulieren und Asm programmieren gibt es auch noch von Oshonsoft den PIC 18 Simulator.
http://oshonsoft.com/pic18.html







Zitieren

Lesezeichen