Hello. Trying to blink a led using 18F45k80.
Seems that I have some config issue, since it does not works on any of the pins - voltage there is around 1.8--2.5v, and does not change. Here's my code. What I'm doing wrong?
Code:
;----[18F45K80 Hardware Configuration]------------------------------------------
#IF __PROCESSOR__ = "18F45K80"
#DEFINE MCU_FOUND 1
#CONFIG
CONFIG RETEN=ON, INTOSCSEL=HIGH, SOSCSEL=HIGH, XINST=OFF, FOSC=HS1, PLLCFG=ON
CONFIG FCMEN=OFF, IESO=OFF, PWRTEN=OFF, BOREN=SBORDIS, BORV=3, BORPWR=ZPBORMV
CONFIG WDTEN=SWDTDIS, WDTPS=512, CANMX=PORTB, MSSPMSK=MSK7, MCLRE=OFF
CONFIG STVREN=ON, BBSIZ=BB2K, CP0=OFF, CP1=OFF, CP2=OFF, CP3=OFF, CPB=OFF
CONFIG CPD=OFF, WRT0=OFF, WRT1=OFF, WRT2=OFF, WRT3=OFF, WRTC=OFF, WRTB=OFF
CONFIG WRTD=OFF, EBTR0=OFF, EBTR1=OFF, EBTR2=OFF, EBTR3=OFF, EBTRB=OFF
#ENDCONFIG
#ENDIF
;----[Verify Configs have been specified for Selected Processor]----------------
; Note: Only include this routine once, after all #CONFIG blocks
#IFNDEF MCU_FOUND
#ERROR "No CONFIGs found for [" + __PROCESSOR__ +"]"
#ENDIF
osccon=%11111111
DEFINE OSC 16
ANCON1=0 'DISABLE ADC D3-D2-D1-D0-
TRISC=%00000000 'set PORTC as output all
TRISD=%00000000 'set PORTD as output all
TRISB=%00000000 'set PORTB as output all
TRISA=%00000000
TRISE=%0000000 'set PORTE as output all
GKO:
HIGH PORTa.0
PAUSE 2000
LOW PORTa.0
PAUSE 2000
GOTO GKO
Bookmarks