Ok about 5 years ago a company came to me with some code to work on, they couldn't find anyone to work on it at all. They tried to fly people in etc... but no luck, lots of talk, very little production. The code was originally written by a IT class and professor as a class project. Runs right about 5000 lines of code. 5 years ago I taught myself the basics and actually managed to make all the changes they wanted. Yea! Me! >>>>TimeWarp 5 years>>>>. Same people contact me about makeing new code for a new device they are working on. All the previous programmers that took the job took the deposit and ran. Can't really blame em because the people I work for are the kind of people who think they know what their doing but don't which makes htem twice as dangerous. Well I accepted the job on salary and the got the assembly code for the old device they need some work on. I try to build the asm and I get all these errors. I comb the code and some idiot was trying to mix C with ASM without declaring anything or that he's gonna write some C code. I filtered that out and it removed all the errors I was having. Now I've got about 200 warning messages saying Operand in not in Bank0 check config bits. Were using the BankSet1 command but its not being recognized anymore.
Heres some code from the BankSet commands.
Include File
Source
Now the code used to run perfectly with no errors or messages. Now everytime BankSet1 is called. The following commands send messages saying operand not in Bank0. Then it goes back to BankSet0 and no more messages. Then call BankSet1 and the lines after it all give the Bank0 message. Any idea whats causing this? It also won't program anymore. I tried hooking my pk3 up to it pin for pin and it won't detect it. Any ideas?
Heres some code from the BankSet commands.
Rich (BB code):
__CONFIG _WDT_OFF & _BODEN_OFF & _PWRTE_ON & _XT_OSC & _LVP_OFF & _DEBUG_OFF & _CPD_OFF
Include File
Rich (BB code):
;Register
PORTA EQU H'0005'
PORTB EQU H'0006'
;Status Bits
RP1 EQU H'0006'
RP0 EQU H'0005'
;Config Bits
_CP_ALL EQU H'1FFF'
_CP_OFF EQU H'3FFF'
_DEBUG_OFF EQU H'3FFF'
_DEBUG_ON EQU H'37FF'
_WRT_OFF EQU H'3FFF' ; No prog memmory write protection
_WRT_256 EQU H'3DFF' ; First 256 prog memmory write protected
_WRT_1FOURTH EQU H'3BFF' ; First quarter prog memmory write protected
_WRT_HALF EQU H'39FF' ; First half memmory write protected
_CPD_OFF EQU H'3FFF'
_CPD_ON EQU H'3EFF'
_LVP_ON EQU H'3FFF'
_LVP_OFF EQU H'3F7F'
_BODEN_ON EQU H'3FFF'
_BODEN_OFF EQU H'3FBF'
_PWRTE_OFF EQU H'3FFF'
_PWRTE_ON EQU H'3FF7'
_WDT_ON EQU H'3FFF'
_WDT_OFF EQU H'3FFB'
_RC_OSC EQU H'3FFF'
_HS_OSC EQU H'3FFE'
_XT_OSC EQU H'3FFD'
_LP_OSC EQU H'3FFC'
Rich (BB code):
#define BankSet0 bcf STATUS,RP0 ; Set the RAM bank to 0
#define BankSet1 bsf STATUS,RP0 ; Set the RAM bank to 1
; Bank-Select Names (for use with BANKSEL directive)
BANK0 EQU PIR1
BANK1 EQU PIE1
BANK2 EQU EEDATA
BANK3 EQU EECON1