Strange PIC12F675 or user problem... pin cross-connect?
email (remove spam text)(Olin Lathrop)
> I am not the only person who
> uses bcf STATUS,RP0
Lots of people don't comment their code, but that doesn't make it a good
> and the datasheet is fairly authoritative, not?
Not when it comes to code. Microchip examples generally suck, and sometimes
contain outright errors. Look at the instruction set, how the machine and
the peripherals work, then write your own code.
> the clrf STATUS could
> have all sorts of intended, and unintended consequences, especially
> since it never works (clrf STATUS will always set STATUS,Z).
Then you might as well wave a dead fish over your programs in case that
makes them work better too.
> Assembler appears to be somewhat like perl, TIMTOWTDI ... ;-)
> Anyway, using hybrid/your logic, it would be better not to have a
> 'clrf STATUS', but to have banksel's before each SFR. Just in case you
> copy/paste the code.
Newbies should use BANKSEL in front of every reference that could be in a
different bank from the previous. Once they get more comfortable with the
rest of the PIC, then they can go back and learn better ways to manage
banking. Explictly writing BSF/BCF on RP0/RP1 is bad programming and is
If you look at my interrupt template module, QQQ_INTR.ASPIC, you will see I
don't use BANKSEL, but my DBANKIF and DBANKIS macros. I force the interrupt
temporary save registers to be in bank 0, and use CLRF STATUS as a single
instruction to select bank 0 regardless of what state STATUS was in or which
14 bit core PIC this is running on. This is immediately followed by DBANKIS
0 and IBANKIS 0 to tell the assembler what the bank settings are. After
that, the bank setting is tracked at assembly time and only the minimum bank
switching instructions are inserted by DBANKIF as needed. This is of course
all explained in the comments too.
> I would rather use
> less efficient mechanisms that work for me and are clear in my head
> that I understand, than use 'better' mechanisms that don't.
That's your business. The discussion was only because you asked for help
here, and apparently did have some problems in this area. Given that, you
might want to revist your thinking.
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014. Gold level PIC consultants since 2000.
See also: www.piclist.com/techref/microchip/devices.htm?key=pic
You must be a member of the
piclist mailing list
(not only a www.piclist.com member) to post to the