          .include  "xc.inc"
          config    FWDT, FWDTEN_OFF       ; Turn off watch dog timer
          .global   __reset
          .text

__reset:
          mov       #__SP_init,W15         ; Initialize stack
          mov       #__SPLIM_init,W0
          mov       W0,SPLIM

;; Pins used in project
;; Output pins
;; Pin 23 on PIC24HJ64GP502  --  AN12 /         RP12 / CN14 / RB12
;; Pin 24 on PIC24HJ64GP502  --  AN11 /         RP13 / CN13 / RB13

;; All pins of the configuration register are initialized.
          setm      AD1PCFGL               ; Set all pins for digital
          clr       CNEN1                  ; Disable change notification
          clr       CNEN2
          clr       CNPU1                  ; Disable weak pullup
          clr       CNPU2
          clr       ODCA                   ; Disable open drain
          clr       ODCB
          clr       TRISA                  ; Set all pins for output
          clr       TRISB

EndLoop:
          bra       EndLoop

          .end
