Thanks for the assistance.
My encoder has detents and has about 24 edges per turn.
I used a pull up of 2x 10 k on both encoder phases and a 2x 0.1uF to ground.
I am using pic18f452 , xtal=10 Mhz, ppl X 4 to get 40 Mhz clock speed.
I used RB0 for the "A" phase as shown on the code.
At the end of the world I am now able to make it working well using the following picbasic program by including Darrel Taylor interrupt routine.
The program prints counter results on a terminal @ 115200 baud rate 8,n,1.
Regards, Ambro


DEFINE OSC 40 ' XTAL= 10 MHZ CLOCK= 40 MHZ
INCLUDE "MODEDEFS.BAS"
INCLUDE "DT_INTS-18.bas" ; Base Interrupt System
INCLUDE "ReEnterPBP-18.bas" ; Include if using PBP interrupts
INTCON2.BIT6=0 ' interrupt from 1 down to 0 on RB0

CNT VAR WORD ' COUNTER TO BE DISPLAYED ON TERMINAL
CNT= 32000
CNTOLD VAR WORD
CNTOLD=32000

B VAR PORTD.1 ' encoder B PHASE
A VAR PORTD.0 ' encoder A PHASE

' DEBUG INTERFACE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\

'' Set Debug pin port ________________________________________
DEFINE DEBUG_REG PORTD
'' Set Debug pin bit _________________________________________ PIC_PIN_30
DEFINE DEBUG_BIT 7
'' Set Debug baud rate _________________________________________
DEFINE DEBUG_BAUD 115200
'' Set Debug mode: 0 = true, 1 = inverted ______________________
DEFINE DEBUG_MODE 1

DEBUG 13,10,13,10, " START OF PROGRAM ", 13, 10, 13, 10

ADCON1=7 ' all digital !

ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler INT_INT, _ToggleLED1, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM

@ INT_ENABLE INT_INT ; enable external (INT) interrupts

Main:
PAUSE 1
IF CNT <> CNTOLD THEN
DEBUG DEC CNT,13,10
CNTOLD=CNT
ENDIF