If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Hi Joe,
First I tries to get Config O.K. so have only a small program for testing config words. Wants ALL digital. Working with a project with MAXIMS iButton chips, works perfect with 16F88.
;************************************************* ***************
;* 16F886.INC *
;* *
;* By : Leonard Zerman, Jeff Schmoyer *
;* Notice : Copyright (c) 2006 microEngineering Labs, Inc. *
;* All Rights Reserved *
;* Date : 05/26/06 *
;* Version : 2.47 *
;* Notes : *
;************************************************* ***************
NOLIST
ifdef PM_USED
LIST
include 'M16F88x.INC' ; PM header
device pic16F886, xt_osc, wdt_on, mclr_on, lvp_off, protect_off
XALL
NOLIST
else
LIST
LIST p = 16F886, r = dec, w = -302
INCLUDE "P16F886.INC" ; MPASM Header
__config _CONFIG1, _XT_OSC & _WDT_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF
NOLIST
endif
LIST
Think the INC file is O.K - But can not understand why it stops working????
'@ DEVICE PIC16F886, INTOSCIO, WDT_ON,MCLR_OFF,LVP_OFF,PROTECT_OFF,BOD_OFF,CPD_OF F,IESO_OFF,FCMEN_OFF,PWRT_ON
'DEFINE OSC 8
OSCCON = %01110001 ' Internal 8 mhz Osc
ANSEL = 0 ' All Digital
ANSELH = 0
'ADCON1 = $0F
'ADCON0 = 0
TRISC = 0
RUN:
PORTC.0 = 1
pause 1000
PORTC.0 = 0
PAUSE 1000
goto RUN
END
Do you recomend to use MPASM assembler? Have now tried more than 2 weeks with this problem.
PORTA is reserved for furure use - PORTA.1 = Input
PORTB %??001111 - RB6 and RB7connected to progsocket for PicKit2.
PORTC %11100100 - RC3 = SCK - RC4 = SDA 24LC256
Would be very great ful for all help and advices
Thanks in advance
Bosse
Hi Joe,
Forget to tell you the Warning from PicKit2.
Warning: Some configuration words not in hex file.
Ensure default values above right are acceptable.
Configuration 2FF9 0700
Bosse
Hi! I am using Microcode Studio version 4.0.0.0 . pbp version is 2.47 . Thanks.
Your answer is likely in this thread: http://www.picbasic.co.uk/forum/showthread.php?t=543
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
http://www.picbasic.co.uk/forum/showthread.php?t=543
What it boils down to....
Method one:
Comment out the config settings in the inc file, put the actual config settings in your source code prefixed by either an @ or inside an ASM block. Use this method if you frequently change this setting or that setting a lot.
Method two:
Comment out the original config settings in the inc file, add in your own config settings to that same inc file in the same place. I use this method since I almost always use the PICs in the same way (i.e. HS_PLL for the 18F, MCLR on, and so on and so on)
Method three (and others)...
Lots of different methods for doing this sort of thing. The 2 above are the 2 that I use.
Check the particular PICs .INC file in the MPASM directory for your particular PICs various options...
Hi Skimask,
Thank you !
Now it starts working, have changed the config in the 16F886.INC file and moved the configuration over to the real program. But still have the warning from PicKit2.
Have to work on and make some small changes and see if the warnings will go away.
I'm not proffessional, but have learned very much from this forum and are very greatful for all your help.
Thank you ALL
Bosse
Probably means that you typed something in wrong, missing a space here or there, have an extra ' character, maybe a " character in there somewhere that shouldn't be...
Post the real CONFIG part that you're using. We can guess at your problem all day. Could be that the tire pressure is low...we'll never know...
Just got back from dinner . . . That is why I asked him to post the .inc file and first 8 lines or so, to see if he introduced an extra character . . .
we can hope . . .Post the real CONFIG part that you're using. We can guess at your problem all day. Could be that the tire pressure is low...we'll never know...
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Hi skimask, Joe and Darrel
Can not find out how to find out about the CONFIG word. Have comment out the CONFIG word in the program. using MPASM assembler. Now I'm really confused. Have been lucky with my other programs for other Controllers, that I can see now.
Really wants to find out how to configure CONFIG word for 16F886.
;************************************************* ***************
;* 16F886.INC *
;* *
;* By : Leonard Zerman, Jeff Schmoyer *
;* Notice : Copyright (c) 2006 microEngineering Labs, Inc. *
;* All Rights Reserved *
;* Date : 05/26/06 *
;* Version : 2.47 *
;* Notes : *
;************************************************* ***************
NOLIST
ifdef PM_USED
LIST
include 'M16F88x.INC' ; PM header
device pic16F886, xt_osc, wdt_on, mclr_on, lvp_off, protect_off
XALL
NOLIST
else
LIST
LIST p = 16F886, r = dec, w = -302
INCLUDE "P16F886.INC" ; MPASM Header
__config _CONFIG1, _INTOSC & _WDT_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF
NOLIST
endif
LIST
I wants to have 8 MHz Internal Oscillator, my PCB have 4k7 resistor to MCLR pin so think MCLR have to be ON?
Also want ALL I/O to be DIGITAL.
Have printed out the INC file from the MPASM directory and the PDF file for 16F886 from MicroChip. Have much to read, but if I understand all???
What can I do to get it work?
Include a short version of the program.
All the Best
Bosse
Hi skimask,
Have changed to INTOSCIO in 16F886.INC and have the following config in program
OSCCON = %01110001 '; Internal 8 mhz Osc
'OSCCON = %01100000
ANSEL = 0 '; All Digital
ANSELH = 0
CM1CON0 = 0
CM2CON0 = 0
ADCON1 = $0F
ADCON0 = 0
TRISA = %00000010
TRISB = %00001111
TRISC = %11100100
The program will not work perfect yet ???
Bosse
According to that CONFIG word, and according to the PIC16F886 datasheet, this is your configuration:
DEBUG mode is OFF
RB3 is I/O
Fail Safe Clock is ON
Int/Ext Clock Switching is ON
BOR is ON
CPD is OFF
CP is OFF
RE3/MCLR is MCLR
PWRT is OFF
WDT is ON
Oscillator mode is INTRC, ClkOut on OSC2, R/C input on OSC1
All Write Protects are Off
What's not right?
I'd be betting it's your spelling of INTRC. Check the 16F886 INC file in the MPASM directory to figure out how to spell it so the assembler is happy.
Hi again skimask,
Have also changed to MPASM assembler and it works better now
Bosse
Bookmarks