Wow amazing took me sometime to understand but I am willing to learn
Thanks eric
Here is the codes
Code:[COLOR="Red"]banksel PORTA banksel TRISB[/COLOR] movlw 0 ;set PORTB as all outputs movwf TRISB banksel PORTB movf CCP1CON,W ;set CCP1 as PWM andlw 0xF0 iorlw 0x0C movwf CCP1CON
Again why Banksel PortA do u think its not needed?
You're only showing part of the complete code, so it's out of context - but I would imagine that before it enters the code section you've shown it was set to bank 1, so the first instruction is to return to bank 0 (the place you normally want to be). In this particular case, the next line sets bank 1 again, so it's likely that BOTH lines could be left out if required.
It's also highly like that the different code segments were 'cut and pasted' together, which is probably why it occurred - but it does no harm.