Como comentaba arriba, estoy usando el pic16F876 y tengo algunas dudas al configurar los puertos
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _HS_OSC&_BODEN_ON&_LVP_OFF
list P=16F876
#INCLUDE <P16F876.INC>
ERRORLEVEL -302,-301,-215
#DEFINE LED1 PORTB,3
#DEFINE LED2 PORTB,2
#DEFINE LED3 PORTB,1
#DEFINE LED4 PORTB,0
#DEFINE RCLED PORTC,4 ;LED verde recibiendo senales
#DEFINE ERRORLED PORTC,5 ;LED rojo indicador de error
#DEFINE RX PORTC,7 ;Entrada UART RX
#DEFINE BREAK DMX_reg,0
#DEFINE STARTCODE DMX_reg,1
#DEFINE MOVED DMX_reg,2
#DEFINE ADDR9 DMX_reg,3
#DEFINE NO_DMX DMX_reg,4
DMX_reg EQU 020h
Reg1 EQU 021h
Reg2 EQU 022h
Reg3 EQU 023h
Reg4 EQU 024h
W_SAVE EQU 026h
S_SAVE EQU 027h
P_SAVE EQU 028h
contadorPWM EQU 029h
flag EQU 02Ah
D_ADDR EQU 02Bh
temp EQU 02Ch
R_ADDR EQU 02Dh
Offset EQU 02Eh
temp2 EQU 02Fh
ORG 00h
GOTO INICIO ;Inicializamos el PIC
ORG 0x05 ;Vector de interruptor
MOVWF W_SAVE ;guardamos el contextos
MOVF STATUS,W ;Guardamos el Estados de PCLATH & W
MOVWF S_SAVE
MOVF PCLATH,W
MOVWF P_SAVE
GOTO gestionar_interrupciones
INICIO ; aqui hice los cambios para el 16F876
BCF STATUS, RP0 ;
BCF STATUS, RP1 ; Bank0
CLRF PORTA ; Borramos la salida del PortA
BSF STATUS, RP0 ; Seleciono el Bank 1
MOVLW 0xFF ; Configure configuro todos los pines como entrada digital
MOVWF ADCON1
MOVLW 0xFF ; y aqui se lo cargo a W
;Aqui uso la mitad del Puerto B como salida y entrada (B7>B4 como entrada y B3>B0 como salida PWM
BCF STATUS,RP0
BCF STATUS,RP1
CRLF PORTB
BSF STATUS,RP0
MOVLW 0F ; aqui B7>B4 como entrada y B3>B0 como salida PWM
BSF TRISC,4 ;Error Trama LED Rojo
BSF TRISC,5 ;Recibiendo LED Verde
BSF TRISC,7 ;PORT C7 entrada UART PIN_18
Por muchos que busco informacion me lio y no se me ponen todos los Puertos A y la mitad de B como los configuros
con el 16F628 me sale todos bien pero necesito mas Pines para los Comuntadores (DIPSWITCH)
por favor alguien que me haga correciones
Saludos