Joe, this it's the error of MCS Plus while try to compile with the config statement :
Error [126] c:\pbp\invento\contro~1.asm 101 : Argument out of range (not a valid config register address)
Last edited by inventosrl; - 2nd December 2008 at 21:13. Reason: mistake
Here is the top part of the code from a set up I have working.
This is using the internal OSC, but you should get the idea.Code:'16F88 DEFINE OSC 8 OSCCON= %01110100 @__CONFIG _CONFIG1, _CP_OFF & _CCP1_RB3 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF & _PWRTE_OFF & _WDT_OFF &_INTRC_IO
You can look in the PicBasic inc file and the inc file in MPASM Suite for all of the possibilities.
Dave
Always wear safety glasses while programming.
OK, open the assembly file the error lists, I think your file is controller.bas, so open controller.asm and look at line 101 and see what it is objecting to. I will play with your code when I get back to my own computer.
EDIT: ok Tested and working with your code set for 4 mhz, as for the error, I get it too:
Code:@ __CONFIG _CONFIG1, _XT_OSC & _WDT_ON & _LVP_OFF & _CP_OFF & _MCLR_ON
Last edited by Archangel; - 3rd December 2008 at 09:22.
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.
Hello, I use this :
PICBASIC PRO(TM) Compiler 2.50
MPASM V.5.2
MPLAB 8.10.00.00
MicroCode Studio Plus ver. 3.0.0.5
Pickit2 Application Version : 2.55.01
Device File Version : 1.53.00
OS Firmware Version : 2.32.00
the first's line of code:
'************************************************* ***************
'* Name : CONTROl.BAS *
'* Author : Giorgio Rossi *
'* Notice : Copyright (c) 2008 Invento S.r.l. *
'* : All Rights Reserved *
'* Date : 02/12/2008 *
'* Version : 1.0 *
'* Notes : *
'* : *
'************************************************* ***************
@ __CONFIG _CONFIG1, _XT_OSC & _WDT_ON & _LVP_OFF & _CP_OFF & _MCLR_ON
INCLUDE "MODEDEFS.BAS"
----- snip
MicroCode Studio Plus Error :
Error [118] c:\invento\control.asm 469 : Overwriting previus address contents (2007)
Line [118] :
_MCSBankEnd EQU MCSByte5
Thanks
giorgio
Here is your code with the configs added in. The PBP inc file has been commented out.
I even programmed a chip. I named the file "invent"
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3041&stc=1&d=122833886 7" />Code:'************************************************* *************** '* Name : CONTROLLER.BAS * '* Author : Giorgio Rossi * '* Notice : Copyright (c) 2008 Invento S.r.l. * '* : All Rights Reserved * '* Date : 26/11/2008 * '* Version : 1.0 * '* Notes : * '* Chip : PIC16F88 * '************************************************* *************** Asm ERRORLEVEL -306 ERRORLEVEL -205 Endasm INCLUDE "MODEDEFS.BAS" @__CONFIG _CONFIG1, _CP_OFF & _CCP1_RB3 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF & _PWRTE_OFF & _WDT_OFF &_XT_OSC TRISA = %00000001 'RA0 Input TRISB = %00000000 'all PORTB output ANSEL = %00000001'only porta.0 is analogue ADCON1 = 7'right justify the result(top bits are read as zero) CMCON = 7 'Turn off comparators adval VAR BYTE i var BYTE RPM VAR BYTE ' Define ADCIN parameters Define ADC_BITS 8 ' Set number of bits in result Define ADC_CLOCK 3 ' Set clock source (3=rc) Define ADC_SAMPLEUS 50 ' Set sampling time in uS PAUSE 500 loop: ADCIN 0,adval serout PORTB.6,n2400, [$FE, 1] serout PORTB.6,n2400, [$FE, 2, "pressione ", #adval] serout PORTB.6,n2400, [$FE, $C0, "giri", #rpm] IF adval < 90 THEN HIGH PORTB.4 endif IF adval > 120 THEN LOW PORTB.4 endif COUNT PORTA.2,250,RPM for i = 1 to rpm toggle PORTB.5 PAUSE 25 NEXT i LOW PORTB.5 GOTO loop 'repeat
Dave
Always wear safety glasses while programming.
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.
Bookmarks