|
Post by murphyfp on Aug 30, 2011 16:50:07 GMT
Hello Paul and one and all I am new here. Looking at the latest code V2.18
In the 629mf LST file there are 12 Messages like this one. I think there should be a Banksel command somewhere. I may be wrong on this but if someone knows how to fix it it would help I think.
0019 300B 00503 movlw B'00001011' ; gp2:5 are outputs, GP3 and GP0:1 inputs Message[302]: Register in operand not in bank 0. Ensure that bank bits are correct. 001A 0085 00504 movwf TRISIO ; 001B 1283 00505 bcf STATUS,RP0 001C 3002 00506 movlw 0x2 ; Leave GP2 as IO and set GP1:0 to comparator in 001D 0099 00507 movwf CMCON
I have remove all unused statements and made things easier to follow for a Three function low power decoder. I intend to use for Coach Lighting in 00 Gauge and L Gauge.
But the 12 messages about Bank 0 are still coming up
I would be grateful for some help with this
|
|
|
Post by Paul Harman on Aug 31, 2011 17:42:38 GMT
Hi Murphyfp and welcome to the forum
Whenever you access a register that is not in bank 0 the there is an informational message generated to remind you. The assembler/linker is not quite bright enough to keep track of the bank select bits.
It is best practice to always set the bank select bits before using the higher banks and then to set the bank select bits back immediately aferwards, but that can use up valuable instruction cycles which cannot be afforded in this application, so I have to keep track of which bank is currently selected and just change banks as required.
To recap, these are not error messages, just informational.
You will have to be a bit careful when removing any code from within the bit reading loop, it must have exactly 44 clock cycles in the loop or the timing will be out and may not work with some command stations. The code that produces the random flicker on the 8-output decoder is a critical part of the timing loop, even on 3-output decoders that don't have flicker.
Paul
|
|
|
Post by murphyfp on Aug 31, 2011 17:58:11 GMT
Hi Paul Thank you for the reply. I can see where you are coming from on this. This was very helpful information once again thank you. I will try your 12f chips on the board I have just built first to make sure all is well when I get some from you first. Then I will play with the firmware.
PS I sent you an email for order.
|
|