Microchip Technology Zena Guide de l'utilisateur Page 46

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 288
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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
Vue de la page 45
1 2 ... 41 42 43 44 45 46 47 48 49 50 51 ... 287 288

Commentaires sur ces manuels

Pas de commentaire