I am trying to use a 16f1847 and can not get it to blink an led I am sure this is a config problem but just can't make it work. this is my config and blink program below.
Thanks!
;----[16LF1847 Hardware Configuration]------------------------------------------
#IF __PROCESSOR__ = "16LF1847"
#DEFINE MCU_FOUND 1
#CONFIG
cfg1 = _FOSC_INTOSC ; INTOSC oscillator: I/O function on CLKIN pin
cfg1&= _WDTE_ON ; WDT enabled
cfg1&= _PWRTE_OFF ; PWRT disabled
cfg1&= _MCLRE_OFF ; MCLR/VPP pin function is digital input
cfg1&= _CP_OFF ; Program memory code protection is disabled
cfg1&= _CPD_OFF ; Data memory code protection is disabled
cfg1&= _BOREN_ON ; Brown-out Reset enabled
cfg1&= _CLKOUTEN_OFF ; CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin
cfg1&= _IESO_ON ; Internal/External Switchover mode is enabled
cfg1&= _FCMEN_ON ; Fail-Safe Clock Monitor is enabled
__CONFIG _CONFIG1, cfg1
cfg2 = _WRT_OFF ; Write protection off
cfg2&= _PLLEN_OFF ; 4x PLL disabled
cfg2&= _STVREN_ON ; Stack Overflow or Underflow will cause a Reset
cfg2&= _BORV_19 ; Brown-out Reset Voltage (Vbor), low trip point selected.
cfg2&= _LVP_OFF ; High-voltage on MCLR/VPP must be used for programming
__CONFIG _CONFIG2, cfg2
#ENDCONFIG
#ENDIF
#IFNDEF MCU_FOUND
#ERROR "No CONFIGs found for [" + __PROCESSOR__ +"]"
#ENDIF
OSCCON = %00001111
ADCON1 = %11111111 'PROBABLY NOT RIGHT??
ANSELA = 0 'PROBABLY NOT RIGHT??
MainLoop:
LED VAR PORTA.0
LED2 VAR PORTA.0
HighLED
High LED2
Pause 500
Low LED
Low LED2
Pause 500
Goto MainLoop
Bookmarks