I hope that you are kidding with us...
Here is your code explained:
tavuka:
PORTA.2=1'<turn on PORTA.2, need 4 osc clock to do that, then next instruction
PORTA.2=0'<turn off PORTA.2 need 4 osc clock to do that, then next instruction
PORTA.4=1'<4 clock to do this, but it doesn't do anything with PORTA.2
PORTA.4=0'<4 clock to do this, but it doesn't do anything with PORTA.2
GOTO TAVUKA '<4 or 8 clocks(can remember) to do this, but it doesn't do anything with PORTA.2
So when you count all clock, you have 4 osc clock long high state on PORTA,2, and 16 clock low state on PORTA.2.
Similar situation is with PORTA.4...
Program execute exactly what you are tell, Not what you want...
Bookmarks