You must use MPASM with DT's interrupts.
Then you will need to use MPASM type configs
http://www.picbasic.co.uk/forum/showthread.php?t=543
You must use MPASM with DT's interrupts.
Then you will need to use MPASM type configs
http://www.picbasic.co.uk/forum/showthread.php?t=543
Dave
Always wear safety glasses while programming.
thank you very much for you answer,
i have used the MPASM and the following line
device pic16F628, @ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN_ON & _LVP_OFF & _CP_ALL & _DATA_CP_ON
but i'm getting the same errors, could you help please?
i used the following config
@ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN_ON & _LVP_OFF & _CP_ALL & _DATA_CP_ON
@device pic16F628a
and now i get the following errors
Remove
device pic16F628,
Dave
Always wear safety glasses while programming.
Seems you edited while I was posting.
now your answer is in the error message.
read through till you come the the ADD part
Dave
Always wear safety glasses while programming.
hi Dave again,
now i get the following errors.
I dont want to disturb you more.
I'm really sad to not understand what are these errors and why it does not work.
regards
Code:'**************************************************************** '* Name : TAG NUMBER.BAS * '* Author : LEONARDO BILALIS * '* Notice : Copyright (c) 2011 [LEONARDOS BILALIS] * '* : All Rights Reserved * '* Date : 11/6/2011 * '* Version : 1.0 * '* Notes : this program allows you to see the * '* : Number of the RFID tag * '* : * '**************************************************************** @ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN_ON & _LVP_OFF & _CP_ALL & _DATA_CP_ON Include "MODEDEFS.BAS" INCLUDE "DT_INTS-14.bas" ' Base Interrupt System INCLUDE "ReEnterPBP.bas" ' Include if using PBP interrupts CMCON = 7 ;----------------------------------------------------------------- LED VAR PORTB.3 ASM INT_LIST macro ; IntSource, Label, Type, ResetFlag? INT_Handler TMR1_INT, _ToggleLED1, PBP, yes endm INT_CREATE ; Creates the interrupt processor ENDASM T1CON = $31 ; Prescaler = 8, TMR1ON @ INT_ENABLE TMR1_INT ; enable Timer 1 interrupts ;----------------------------------------------------------------- DEFINE OSC 8 'Set oscillator in MHz DEFINE LCD_DREG PORTB 'define port to LCD DEFINE LCD_DBIT 4 'RB4 RB5 RB6 RB7 to D4 D5 D6 D7 display DEFINE LCD_RSREG PORTA 'RS on porta DEFINE LCD_RSBIT 0 'RS on porta.0 DEFINE LCD_EREG PORTA 'Enable on porta DEFINE LCD_EBIT 1 'Enable porta.1 DEFINE LCD_BITS 4 ' DEFINE LCD_LINES 2 'lines 2 PAUSE 200 ' Stop 200ms ;---------------------------------- LCDOUT $FE,1 ' power lcd Lcdout $FE,1,4 lcdout $FE, 1," Copyright 2011" lcdout $FE, $C0,"Leonardo Bilalis" ;---------------------------------- ' -----[ Variables ]------------------------------------------------------- buf VAR byte [10]' RFID bytes buffer tagNum VAR Byte ' from EEPROM table idx VAR Byte ' tag byte index char VAR Byte ' character from table Main: pause 500 lcdout $FE,1," Please use your" lcdout $FE, $C0,"Personal RFIDTAG" pause 500 SERIN2 portb.1, 84, [WAIT($02),Str buf\10] pause 1000 LCDout $fe,1, "TAG ID:" lcdout $fe,$C0, "NO: ", str buf\10 pause 5000 goto main '---[TMR1 - interrupt handler]-------------------------------------------------- ToggleLED1: TOGGLE led @ INT_RETURN
Last edited by astanapane; - 11th June 2011 at 17:13.
No problem.I dont want to disturb you more
Try changing the config line to
@ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _LVP_OFF & _CP_OFF
and make sure the *.inc file is commented.
Then add
wsave VAR BYTE $70 SYSTEM
in your VAR section
Dave
Always wear safety glasses while programming.
i have fixed a lot of problems by adding your suggestions.
now i only get the followingCode:'**************************************************************** '* Name : TAG NUMBER.BAS * '* Author : LEONARDO BILALIS * '* Notice : Copyright (c) 2011 [LEONARDOS BILALIS] * '* : All Rights Reserved * '* Date : 11/6/2011 * '* Version : 1.0 * '* Notes : this program allows you to see the * '* : Number of the RFID tag * '* : * '**************************************************************** @ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _LVP_OFF & _CP_OFF wsave VAR BYTE $20 SYSTEM ' location for W if in bank0 ;wsave VAR BYTE $70 SYSTEM ' alternate save location for W ' if using $70, comment wsave1-3 ' --- IF any of these three lines cause an error ?? ------------------------ ' Comment them out to fix the problem ---- ' -- Which variables are needed, depends on the Chip you are using -- wsave1 VAR BYTE $A0 SYSTEM ' location for W if in bank1 wsave2 VAR BYTE $120 SYSTEM ' location for W if in bank2 ;wsave3 VAR BYTE $1A0 SYSTEM ' location for W if in bank3 Include "MODEDEFS.BAS" INCLUDE "DT_INTS-14.bas" ' Base Interrupt System INCLUDE "ReEnterPBP.bas" ' Include if using PBP interrupts CMCON = 7 ;----------------------------------------------------------------- LED VAR PORTB.3 ASM INT_LIST macro ; IntSource, Label, Type, ResetFlag? INT_Handler TMR1_INT, _ToggleLED1, PBP, yes endm INT_CREATE ; Creates the interrupt processor ENDASM T1CON = $31 ; Prescaler = 8, TMR1ON @ INT_ENABLE TMR1_INT ; enable Timer 1 interrupts ;----------------------------------------------------------------- DEFINE OSC 4 'Set oscillator in MHz DEFINE LCD_DREG PORTB 'define port to LCD DEFINE LCD_DBIT 4 'RB4 RB5 RB6 RB7 to D4 D5 D6 D7 display DEFINE LCD_RSREG PORTA 'RS on porta DEFINE LCD_RSBIT 0 'RS on porta.0 DEFINE LCD_EREG PORTA 'Enable on porta DEFINE LCD_EBIT 1 'Enable porta.1 DEFINE LCD_BITS 4 ' DEFINE LCD_LINES 2 'lines 2 PAUSE 200 ' Stop 200ms ;---------------------------------- LCDOUT $FE,1 ' power lcd Lcdout $FE,1,4 lcdout $FE, 1," Copyright 2011" lcdout $FE, $C0,"Leonardo Bilalis" ;---------------------------------- ' -----[ Variables ]------------------------------------------------------- buf VAR byte [10]' RFID bytes buffer tagNum VAR Byte ' from EEPROM table idx VAR Byte ' tag byte index char VAR Byte ' character from table Main: pause 500 lcdout $FE,1," Please use your" lcdout $FE, $C0,"Personal RFIDTAG" pause 500 SERIN2 portb.1, 84, [WAIT($02),Str buf\10] pause 1000 LCDout $fe,1, "TAG ID:" lcdout $fe,$C0, "NO: ", str buf\10 pause 5000 goto main '---[TMR1 - interrupt handler]-------------------------------------------------- ToggleLED1: TOGGLE led @ INT_RETURN
error [118] overwriting previous address contents [2007]
Gettin there....
Take a look at this
http://www.picbasic.co.uk/forum/show...=6775#post6775
When the configs are set in code space the *.inc file needs the config lines commented.
Dave
Always wear safety glasses while programming.
Bookmarks