1 Jul 01:06
Re: [PIC] Strange PIC12F675 or user problem... pin cross-connect?
Rolf <learr <at> rogers.com>
2008-06-30 23:06:29 GMT
2008-06-30 23:06:29 GMT
That's fascinating observation... The code itself is unmodified from the 'template' as supplied by Microchip, so I would be surprised... but, two observations.... 1. If the MOVF,w changes Z before actually moving the value, then you may be right, otherwise I think it is 'bulletproof'. 2. in your alternative suggestion, you have an issue with the 'restore' section. you use swapf to get STATUS in to W, so the nybbles will be swapped, so you only need one swapf to restore them in the return. So, when exactly does the STATUS value get moved from the register to W? According to mid-range-manual.... well, it appears that the register (status) is read before the values are processed (thus re-affecting status). Hmm. It all looks OK to me, though, using swapf may save an instruction in the ISR.... Rolf Tamas Rudnai wrote: > Hi Rolf, > > I believe that the context saving is not right in your code. You likely to > overwrite Z flag, however, I can't see any section of your code that would > use the zero flag so it might not be the case. > > Tamas > > >(Continue reading)
RSS Feed