you will need to post some code that demonstrates that problem
you will need to post some code that demonstrates that problem
Warning I'm not a teacher
Here is the code listing. The compiler complains about the RCSTA1.7 = 0 command. If I comment it out, the rest of the code compiles fine. The error message is "bad expression"
code:
recvoff:
RCSTA1.7 = 0
while ! TXSTA1.1 :wend 'wait til TX completes
TXSTA1.5 = 0 'turn off EUSART1 TX
END SELECT 'done with this
return
That code sure doesn't compile but it's not because of RCSTA1.7=0 but rather END SELECT. If I remove END SELECT the reset does compile here.
Since you claim it compiles if you comment out RCSTA1.7=0 I suspect the code you posted isn't what you're trying to compile - which doesn't help.
Which version of PBP do you have and which version of MPLAB/MPASM are you using?
Goto the MPASMX folder and open the file p18f46k80.inc, look for the lines:Also goto your PBP3 installation folder, open DEVICES and then open PIC17F46K80.PBPINC, look for the lines:Code:RCSTA EQU H'0FAB' RCSTA1 EQU H'0FAB'Can you find these entries in both of the above files?Code:RCSTA1 VAR BYTE EXT ; BANKA RCSTA VAR BYTE EXT ; BANKA (Legacy/Migration
Hello Henrik,
you and I have talked about this code a few times now. I had to change my name to protect the guilty! Actually I lost my original password and tried to recover the password but never got a response so I just created a new one.
Yes, both files are there, and all the declarations are also there. I moved the end select statement so this code should execute no matter what happens above it.
It still won't compile.Code:CASE ELSE hserout ["Ending changes",13,10] write lockadd, word $5A5A 'relock so values don't change. END SELECT 'done with this recvoff: RCSTA1.7 = 0 while ! TXSTA1.1 :wend 'wait til TX completes TXSTA1.5 = 0 'turn off EUSART1 TX return
Thanks,
Paul
Hi Paul,
The following compiles here, using PBP 3.1.6.4 and MPASM 5.87:Try copy/pasting the above code (not your original code, but the above) into a new file and compile it for the 46K80.Code:recvoff: RCSTA1.7 = 0 while ! TXSTA1.1 :wend 'wait til TX completes TXSTA1.5 = 0 'turn off EUSART1 TX
It's a real longshot but I have had weird things happening where some character have not been what it looks like. Can't really explain it but deleting ALL of the offending line and type it again solved the issue.
/Henrik.
Thanks Henrik,
well, you nailed it, and I don't know why. I deleted the original code and inserted yours and it compiled fine. Just for fun I'll look at the ascii code originally there and see if there is a hidden character that was causing the problem. Thanks for all your help with this. I really appreciate it. If I find something hidden, I'll get back to you. Thanks again.
Paul
Bookmarks