Have you commented out the shebang line in the inc?
http://www.picbasic.co.uk/forum/show...75&postcount=5
Have you commented out the shebang line in the inc?
http://www.picbasic.co.uk/forum/show...75&postcount=5
Dave
Always wear safety glasses while programming.
This is the last part of my untouched inc file:
Code:;========================================================================== ; ; Configuration Bits ; ;========================================================================== _CONFIG1 EQU H'2007' _CONFIG2 EQU H'2008' ;Configuration Byte 1 Options _CP_ALL EQU H'1FFF' _CP_OFF EQU H'3FFF' _CCP1_RB0 EQU H'3FFF' _CCP1_RB3 EQU H'2FFF' _DEBUG_OFF EQU H'3FFF' _DEBUG_ON EQU H'37FF' _WRT_PROTECT_OFF EQU H'3FFF' ;No program memory write protection _WRT_PROTECT_256 EQU H'3DFF' ;First 256 program memory protected _WRT_PROTECT_2048 EQU H'3BFF' ;First 2048 program memory protected _WRT_PROTECT_ALL EQU H'39FF' ;All of program memory protected _CPD_ON EQU H'3EFF' _CPD_OFF EQU H'3FFF' _LVP_ON EQU H'3FFF' _LVP_OFF EQU H'3F7F' _BODEN_ON EQU H'3FFF' _BODEN_OFF EQU H'3FBF' _MCLR_ON EQU H'3FFF' _MCLR_OFF EQU H'3FDF' _PWRTE_OFF EQU H'3FFF' _PWRTE_ON EQU H'3FF7' _WDT_ON EQU H'3FFF' _WDT_OFF EQU H'3FFB' _EXTRC_CLKOUT EQU H'3FFF' _EXTRC_IO EQU H'3FFE' _INTRC_CLKOUT EQU H'3FFD' _INTRC_IO EQU H'3FFC' _EXTCLK EQU H'3FEF' _HS_OSC EQU H'3FEE' _XT_OSC EQU H'3FED' _LP_OSC EQU H'3FEC' ;Configuration Byte 2 Options _IESO_ON EQU H'3FFF' _IESO_OFF EQU H'3FFD' _FCMEN_ON EQU H'3FFF' _FCMEN_OFF EQU H'3FFE' ; To use the Configuration Bits, place the following lines in your source code ; in the following format, and change the configuration value to the desired ; setting (such as CP_OFF to CP_ALL). These are currently commented out here ; and each __CONFIG line should have the preceding semicolon removed when ; pasted into your source code. ;Program Configuration Register 1 ; __CONFIG _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF & _PWRTE_OFF & _WDT_OFF & _HS_OSC ;Program Configuration Register 2 ; __CONFIG _CONFIG2, _IESO_OFF & _FCMEN_OFF LIST
That is the inc file from MPASM, do not modify it. That is where you get info about the chip.
The inc file you modify is in the PBP directory. It looks like this.
Notice the ';' That is a comment for this type of file. The two lines between LIST and LIST with comments are the lines to change or if setting the fuses in code space comment out.Code:NOLIST ifdef PM_USED LIST include 'M16F88.INC' ; PM header ; device pic16F88, hs_osc, wdt_on, lvp_off, protect_off XALL NOLIST else LIST LIST p = 16F88, r = dec, w = -302 INCLUDE "P16F88.INC" ; MPASM Header ; __config _CONFIG1,_INTRC_IO& _WDT_ON & _LVP_OFF & _CP_OFF NOLIST endif LIST
Dave
Always wear safety glasses while programming.
Thanks for your patience Dave!
Well, I commented out the two lines as you suggested recompiled and put the code into the PIC and it froze! Tried a few times and also tried to reset the PIC but noting, stone cold! I opened the inc file, restored it, recompiled the code and it was all back to normal.
I must have my stupid hat on this week, this thing just won’t fly!
If you ser the fuses in code space then comment the two lines. Otherwise do like you are in the inc file.
Personally I like to set up in the inc.
Does it work at all now?
Dave
Always wear safety glasses while programming.
I commented out the two lines in the inc file and added the ” @__config _CONFIG1,_INTRC_IO& _WDT_ON & _LVP_OFF & _CP_OFF” to the code right below the “@__config_INTRC_IO” line but it refuses to compile! I get “[235] opcode expected instead of ‘_hs_osc’” error! ?
If I remove the line it compiles and everything except RA6 & RA7 I/O run perfect as before.
I am confused to say the least!
Thanks for the support!
http://www.picbasic.co.uk/forum/showthread.php?t=543
Have you tried this thread yet? And I do mean the whole thing, not just the first and/or last post, but everything in between, everything linked, and then try everything in there to get a feel for how everything works?
Not that you'll ever need to use everything in there, but down the road, something in this thread might come up and you'll have that knowledge in the back of your head ready to go...and it'll save you loads of time...then...
Last edited by skimask; - 10th July 2008 at 18:06.
I have an idea. Copy this code exactly and tell us if RA6 and RA7 ports flash an LED. Put about 100 ohms on 1 side of the LED. I just tried it with a 16F88 and it works for me.
OSCCON = $60 'set int osc to 4mhz
ANSEL = 0 'ALL DIGITAL
CMCON = 7 'COMPARATORS OFF
TRISA = %00000000 'ALL OUTPUTS
TRISB = %00000000 'ALL OUTPUTS
PORTA = 0 'PORTA LOW
@ DEVICE MCLR_OFF, INTRC_OSC, WDT_ON, LVP_OFF, BOD_OFF, PWRT_ON, PROTECT_ON
Pause 100 'SETTLE DOWN
START:
High PORTA.6 'ON LED
High PORTA.7
Pause 1000
Low PORTA.6 'OFF LED
Low PORTA.7
Pause 1000
GoTo START 'REPEAT FOREVER
Bookmarks