PDA

View Full Version : Cannot compile 16F15345



kenif
- 25th April 2018, 00:15
Can't find anything on forum.

The default config doesn't work, nor any of my attempts to fix it.
Latest IDE, latest PBP Gold 3.1. Current Microchip everything.
This board worked fine with a 18F13K22 but someone insisted we go to 16F15345.
It has a 16Meg external oscillator and needs 4x PLL.

#CONFIG
__config _CONFIG1, _FEXTOSC_OFF & _RSTOSC_HFINT32 & _CLKOUTEN_OFF & _CSWEN_ON & _FCMEN_ON
__config _CONFIG2, _MCLRE_ON & _PWRTE_ON & _LPBOREN_OFF & _BOREN_ON & _BORV_LO & _ZCD_OFF & _PPS1WAY_OFF & _STVREN_ON
__config _CONFIG3, _WDTCPS_WDTCPS_11 & _WDTE_ON & _WDTCWS_WDTCWS_6 & _WDTCCS_HFINTOSC
__config _CONFIG4, _BBSIZE_BB512 & _BBEN_OFF & _SAFEN_OFF & _WRTAPP_OFF & _WRTB_OFF & _WRTC_OFF & _WRTSAF_OFF & _LVP_OFF
__config _CONFIG5, _CP_OFF
#ENDCONFIG

It doesn't like the other type of config, either, returning: (Processor "16F15345" is invalid for CONFIG directive.)

Thanks in anticipation, Ken.

8623

richard
- 25th April 2018, 01:20
ASM ERROR] (Invalid OSC Define.) (0) : Error[101]
ASM ERROR] Symbol not previously defined (PAUSEUSL) (0) : Error[113]

is not a config error , the problem lies in the code not posted , somewhere an
invalid OSC define exists

mpgmike
- 25th April 2018, 15:51
What jumps out for me is you say you are using a 16 MHz external oscillator, yet in your CONFIG statement you list:



_FEXTOSC_OFF & _RSTOSC_HFINT32

Your CONFIG should have _FEXTOSC_EHC & _RSTOSC_EXT1X.

Also, since you didn't post the rest of your code, I am taking a guess here. The 16F15345 has an SFR called OSCEN that allows you to turn ON different oscillators. Bit 7 enables your EXTernal OSCillator (EXTOSC), bit 6 enables your HFINTOSC you are using for your Watch Dog Timer (_WDTCCS_HFINTOSC in your CONFIG3).

In my experience, the Compiler will generate totally non-related Errors at times. I would start here.

kenif
- 25th April 2018, 18:09
You guys are right as usual. It had define OSC 64 for historical reasons.
Here's the story: This is the guts for a lung ventilator.
I designed all the boards, and do firmware everywhere else, but another programmer does this one board.
It originally had 18F13K22 with 16Meg PLL to 64, worked great. The other programmer insisted he had to have another UART for debug because he doesn't like to bitbash (even for debug?), and picked this chip as a replacement. I now need to change the simple routine that tests the hardware.
It doesn't run at 64M, max 32, but no one bothers to tell me, and it still has a 16M oscillator :)

kenif
- 25th April 2018, 18:11
Yes, I posted the default. I tried lots of combinations but was trying to get this chip to run at 64 MHZ, when the max is 32.