PIE / PIR problem

R

Russ_Verdon

Jan 1, 1970
0
Hi, can a PIC programming guru help me out please?

BSF STATUS,RP0 ;BANK1
BSF PIE1,0 ;ENABLING TIMER1 OVERFLOW FLAG
BSF PIE1,2 ;ENABLING CCP1 INTERRUPT FLAG

I have the above lines of code in my program but when I assemble them in
MPLAB I get the following
BSF STATUS, 0x5
BSF PIR1, 0
BSF PIR1, 0x2

As you can see the PIE1 gets changed into a PIR1 !!!!!
Does anyone know what is going on here?

Thanks
Russell
 
S

Spehro Pefhany

Jan 1, 1970
0
Hi, can a PIC programming guru help me out please?

BSF STATUS,RP0 ;BANK1
BSF PIE1,0 ;ENABLING TIMER1 OVERFLOW FLAG
BSF PIE1,2 ;ENABLING CCP1 INTERRUPT FLAG

I have the above lines of code in my program but when I assemble them in
MPLAB I get the following
BSF STATUS, 0x5
BSF PIR1, 0
BSF PIR1, 0x2

As you can see the PIE1 gets changed into a PIR1 !!!!!
Does anyone know what is going on here?

Thanks
Russell

PIR1 and PIE1, for example, have the same address (0x0C), just
different SFR banks, so whatever disassembler you are using just
doesn't know which bank you are in..

Usually you get a display more like:

BSF 0x0C, 0

What exactly are you looking at to see the lines you quote?
What version of MPLAB?


Best regards,
Spehro Pefhany
 
R

Russ_Verdon

Jan 1, 1970
0
Spehro Pefhany said:
PIR1 and PIE1, for example, have the same address (0x0C), just
different SFR banks, so whatever disassembler you are using just
doesn't know which bank you are in..

Usually you get a display more like:

BSF 0x0C, 0

What exactly are you looking at to see the lines you quote?
What version of MPLAB?


Best regards,
Spehro Pefhany


Thanks for the response Sphero,
version is MPLAB 6.20.0.0
I started a project in MPLAB imported my asm file, selected the 16f628
device and did a "quickbuild". It assembled with no errors(after a few
corrections naturally), then I did "menu view program memory" and found the
above issue which was borne out when stepping through the code and watching
the FSR view changing FSReg 0C.

As you said BSF 0x0C, 0 is what is shown in the :machine view of the program
memory window, but the symbolic view shows the PIR (not PIE , this may be
just an issue with their symbolic view, not taking banks into account).
I stepped through again this morning and found that the correct Reg 8C was
being changed, I swear it was 0C yesterday...

Oh well thanks for making me look more closely at what is going on.
Have a good Christmas
Regards Russell
 
Top