Microchip Technology Zena Betriebsanweisung Seite 46

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 288
  • Inhaltsverzeichnis
  • FEHLERBEHEBUNG
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 45
MPLAB
®
IDE User’s Guide
DS51519B-page 36 © 2006 Microchip Technology Inc.
FIGURE 2-13: TEMPLATE FILE – MAIN
When any source file is opened, you are automatically in the editor. Type in this code
beneath Main:
clrf WREG
movwf PORTC ; clear PORTC
movwf TRISC ; configure PORTC as all outputs
Init
clrf COUNT,A ; initialize counter
IncCount
incf COUNT,F,A
movf COUNT,W,A ; increase count and
movwf PORTC ; display on PORTC
call Delay ; go to Delay subroutine
goto IncCount ; infinite loop
Delay
movlw 0x40
movwf DVAR2,A ; set outer delay loop
DelayOuter
movlw 0xFF
movwf DVAR,A ; set inner delay loop
DelayInner
decfsz DVAR,F,A
goto DelayInner
decfsz DVAR2,F,A
goto DelayOuter
return
Seitenansicht 45
1 2 ... 41 42 43 44 45 46 47 48 49 50 51 ... 287 288

Kommentare zu diesen Handbüchern

Keine Kommentare