Sorry, it's a 16f886.
Thanks for your reply!
Try this:
@ __CONFIG _CONFIG1, _INTOSCIO & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _LVP_OFF & _BOR_ON
CM1CON0 = 0
CM2CON0 = 0
You will get overwriting previous address error unless you comment out the config statement in your 16F886.inc file in the root of your PBP directory, because there is already a config statement there and PBP blends or includes this file into the compile automaticly.
JS
Last edited by Archangel; - 16th September 2007 at 07:00.
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.
Thanks Joe but it still didn't work with your lines of code. The error I get is:
Error blink.asm 66:[235] opcode expected instead of '_config'
The CMCON line gives a compiler error as well. Is this command not supported on the PIC16F886 perhaps?
The total code is:
Code:@ __CONFIG _CONFIG1, _INTOSCIO & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _LVP_OFF & _BOR_ON CM1CON0 = 0 CM2CON0 = 0 TRISB = %00000000 ANSEL=0 ANSELH=0 define osc 4 'CMCON = 7 led var PORTB.0 led1 var PORTB.1 led2 var PORTB.2 led3 var PORTB.3 led4 var PORTB.4 led5 var PORTB.5 led6 var PORTB.6 led7 var PORTB.7 loop: High led ' Turn on LED connected to PORTB.0 High led1 ' Turn on LED connected to PORTB.0 High led2 ' Turn on LED connected to PORTB.0 High led3 ' Turn on LED connected to PORTB.0 High led4 ' Turn on LED connected to PORTB.0 High led5 ' Turn on LED connected to PORTB.0 High led6 ' Turn on LED connected to PORTB.0 High led7 ' Turn on LED connected to PORTB.0 Pause 500 ' Delay for .5 seconds Low led ' Turn off LED connected to PORTB.0 low led1 low led2 low led3 low led4 low led5 low led6 low led7 Pause 500 ' Delay for .5 seconds Goto loop ' Go back to loop and blink LED forever End
I can answer that too ! You are using PM as the assembler and those configs are written for use of MPASM. Download from microchips website, then go into microcode studios Tabs across the top, click view, go down to compile and program options, open the tab that says, assembler, and check the little white box that says use MPASM. Then you will be using the assembler almost all of the Top Guns in here use, so their code snippets and programs will work for you.<p>
Read this thread too: http://www.picbasic.co.uk/forum/show...t=config+fuses<p>
Try this using PM assembler : @ DEVICE pic16F886, INTOSCIO,WDT_ON,MCLR_OFF,LVP_OFF
Last edited by Archangel; - 16th September 2007 at 07:34.
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 rjones2102,
first:
comparator register is CM1CON0. if you look at the datasheet pg. 80 it will tell you how to arrange the bits so that you can turn it off. in this case CM1CON0.7=0 will turn off Comparator 1 because bit 7 in CM1CON0 Register is enable/disable register. same with comparator 2: CM2CON0.7 = 0.
second:
I used to get erros in PBP when i adjusted the fuses (config register) in PBP. the way i got around this is like joe said, instead of declaring: @ __CONFIG _CONFIG1, _INTOSCIO & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _LVP_OFF & _BOR_ON
go to the .inc file and edit your fuses there. i believe it would be in c:\PBP folder
last:
i don't know if it matters but the way i usually set up my registers, is i first begin with osc, then with other stuff.
Thanks guys,
I will take all of that on board. Your help has undoubtedly saved me hours but certainly hasn't detracted from my learning!
Thanks
Rich
Bookmarks