This eliminates the xorwf INDF1, F statement, so not a great idea.Originally Posted by Brock
Yea, the BRA $ + 2 are relative branches and it won't work properly on a PIC18F with $ + 1. The reason for this is the PC18F instructions are two bytes long, so a $+1 will branch to the middle of an instruction. $+2 branches to the next instruction. It has the simple effect of causeing a 2 instruction cycle delay with one command (in lieu of using 2 nop commands).So then I tried changing all the "2"s to "1"s in the "else" section. I got errors when I compiled.
This is what I was getting at. I think with a little tinkering, the active pulse could be lengthened, while keeping the inactive state short, but I can't go there now. Maybe if I get to it in the future I'll follow up in this thread (who knows when that may be!). Besides, I'd want to take a good look at the timing specs before fiddling with this too much. But it is good to know what you have confirmed already.So, I deleted the "if" statementsfor the lower speed oscillators and it looks pretty good now. I still wish it was faster, but speeding it up seems to shrink the active pulse width too much.
Steve
Bookmarks