View Full Version : RT Config issue
Charles Linquis
- 28th August 2009, 17:04
I have been successfully using DT's RTCONFIG with an offset,
For example
@ ReadConfig?CB _CONFIG1H, _OSCTYPE
But when I try to use the line
@ ReadConfig?BB 200000h, _User1
I get the error message
"Register in operand not in bank0. Ensure that bank bits are correct."
Can someone tell me what I'm doing wrong?
Darrel Taylor
- 28th August 2009, 20:07
HI Charles,
The @ ReadConfig?BB macro uses a BYTE variable as an offset from 300000h (CONFIG space). It can't read the ID locations (200000).
You can read them with the ?CB macro ...
@ ReadConfig?CB 200000h, _User1
--OR--
@ ReadConfig?CB _IDLOC0, _User1
Or you could add this macro to the RTconfig include, which will let you use an offset from the first ID loc...
ReadID?BB macro Breg, Bout
movlw upper(_IDLOC0)
movwf TBLPTRU, A
movlw high(_IDLOC0)
movwf TBLPTRH, A
movff Breg, TBLPTRL
TBLRD* ; read the ID byte
movff TABLAT, Bout
endm
Then you could ...
FOR X = 7 to 0 STEP -1
@ ReadID?BB _X, _User1
LCDOUT HEX2 User1
NEXT X
Charles Linquis
- 29th August 2009, 00:40
Thanks!
I should have looked at your code for the answer, but it is month-end around here and I don't even have time to do anything constructive!
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.