Gast
#2462748
Hallo, ich habe ein Problem bei der Programmierung des PIC16f690. Ich möchte die übliche Anwendung einer Uhrenschaltung mit einem 32768Hz Uhrenquarz programmieren. Aus dem Grund erzeuge ich mit einem Vorteiler von 32:1 einen Interrupt im sekundentakt. Soweit so gut. Allerdings möchte ich zu Testzwecken einfach im sekundentakt erst einmal eine LED des PIC Kit 2 an und ausschalten. dazu verODERe ich den PORTC mit einer Bitmaske... (0x01) Das Problem: DIE VERDAMMTE LED BLEIBT IMMER AN!!!! Assembler Code: #include <p16F690.inc> __config (_XT_OSC & _WDT_OFF & _PWRTE_ON & _MCLRE_OFF & _CP_OFF & _BOR_OFF & _IESO_OFF & _FCMEN_OFF) takt EQU .32768 whelp EQU 0x20 shelp EQU 0x21 maske EQU 0x22 org 0 goto start org 4 goto interrupt start: bsf STATUS,RP0 ;Bank1 clrf TRISA ;Port A, B und C Ausgang clrf TRISB clrf TRISC movlw B'00000100' ;interner Taktteiler auf 256 movwf OPTION_REG bsf STATUS,RP1 ;Bank2 clrf ANSEL ;alle I/O Ports digital clrf ANSELH bcf STATUS,RP1 ;Bank 0 bcf STATUS,RP0 bsf INTCON,T0IE ;TMR0 & Interrupts freigeben bcf INTCON,T0IF bsf INTCON,GIE clrf PORTA ;Port A, B und C Low clrf PORTB clrf PORTC goto loop loop: goto loop interrupt: movf PORTC,w xorlw 0x01 movwf PORTC bcf INTCON,T0IF retfie end Bitte seht mir nach falls es sich um einen trivialen Fehler handelt... Aber das treibt mich in den Wahnsinn.