Out to do more test in the test area...
Out to do more test in the test area...
Last edited by mister_e; - 16th September 2011 at 20:37.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
last test, sorry ....
Was ok the first time I posted it, messed when use the QuickEdit... so before posting it again, I switched to Advanced Moxe...paste the code again and we're up! DamnCode:#CONFIG __CONFIG _CONFIG1, _FCMEN_OFF & _IESO_OFF & _FOSC_INTOSC & _PLLEN_OFF & _WDTE_SWDTEN & _MCLRE_OFF & _CP_OFF & _BOREN_OFF & _PWRTE_OFF __CONFIG _CONFIG2, _LVP_OFF #ENDCONFIG OSCCON = %01111000 ' x------- SPLLEN: don't care when _PLLEN_OFF in config fuse ' -1111--- Internal clock = 16MHz ' -----x-- Unimplemented ' ------00 System Clock Source = Determined by Config Word DEFINE OSC 16 ' Tell PBP we use a 16MHz Clock![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
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
Just a casual observation; you're posting to a 9 year old thread instead of starting your own. In this 9 year old thread you can plainly see the working examples listed in previous posts:
You list your own thing and wonder why it doesn't work for you. Am I being overly critical?!?Code:#CONFIG __CONFIG _CONFIG1, _FCMEN_OFF & _IESO_OFF & _FOSC_INTOSC & _PLLEN_OFF & _WDTE_SWDTEN & _MCLRE_OFF & _CP_OFF & _BOREN_OFF & _PWRTE_OFF __CONFIG _CONFIG2, _LVP_OFF #ENDCONFIG
This fixed my problem. I did not notice I had ticked 16fl1847 not 16f1847 in MeConfig . I changed "OSCCON = %11100000" to "OSCCON = %01110000" and added "DEFINE OSC 8". I am glad I figured it out before anyone answered.
;----[16F1847 Hardware Configuration] From MeConfig--------------------------
#IF __PROCESSOR__ = "16F1847"
#DEFINE MCU_FOUND 1
#CONFIG
cfg1 = _FOSC_INTOSC ; INTOSC oscillator: I/O function on CLKIN pin
cfg1&= _WDTE_OFF ; WDT disabled
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_OFF ; Brown-out Reset disabled
cfg1&= _CLKOUTEN_OFF ; CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin
cfg1&= _IESO_OFF ; Internal/External Switchover mode is disabled
cfg1&= _FCMEN_OFF ; Fail-Safe Clock Monitor is disabled
__CONFIG _CONFIG1, cfg1
cfg2 = _WRT_OFF ; Write protection off
cfg2&= _PLLEN_OFF ; 4x PLL disabled
cfg2&= _STVREN_OFF ; Stack Overflow or Underflow will not cause a Reset
cfg2&= _BORV_HI ; Brown-out Reset Voltage (Vbor), high trip point selected.
cfg2&= _LVP_OFF ; High-voltage on MCLR/VPP must be used for programming
__CONFIG _CONFIG2, cfg2
#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
ANSELA = 0 ' Turn off analog port A
ANSELB = 0 ' Turn off analog port B
CM1CON0 = 0 ' Comparators off.
CM1CON1 = 0
CM2CON0 = 0 ' Comparators off.
CM2CON1 = 0
CPSCON0 = 0 ' Capacitive sense module off.
TRISB = %00000000
OSCCON = %01110000
ADCON1 = %11111111
DEFINE OSC 8
Bookmarks