BUENAS A TODOS.
ALGUIEN A PROGRAMADO ESTE EXPANSOR DE PUERTOS CON PROTON??? NO CONSIGO HACERLO FUNCIONAR
Device = 16F877A
Xtal 20
Declare Reminders = Off
Config CP_OFF, DEBUG_OFF, WRT_OFF, CPD_OFF, LVP_OFF, PWRTE_ON, WDT_OFF, HS_OSC, BOREN_OFF, WDTE_OFF
Declare Reminders = On
Declare LCD_Type 0
Declare LCD_DTPin PORTD.4
Declare LCD_RSPin PORTD.2
Declare LCD_ENPin PORTD.3
Declare LCD_Lines 4
Declare SDA_Pin PORTC.4
Declare SCL_Pin PORTC.3
Declare Slow_Bus yes
Declare All_Digital true
Declare PortB_Pullups = 1
Dim a As Byte
Dim b As Byte
Dim c As Byte
Dim d As Byte
Symbol leer=%01000001
Symbol grabar=%01000000
Symbol led=PORTD.0
TRISA = 0
TRISB = %00001111
TRISC = 0
TRISD = 0
TRISE = 0
'********************************
PORTA = 0
PORTB = 0
PORTC = 0
PORTD = 0
PORTE = 0
Cls
DelayMS 10
High led
Print At 1,1,"hola"
DelayMS 100
Low led
Cls
configura:
BStart
BusOut grabar,0,[%11111111]
DelayMS 15
BusOut grabar,1,[%00000000]
DelayMS 15
BusOut grabar,2,[%00000000]
DelayMS 15
BusOut grabar,5,[%10101010]
BStop
inicio:
BStart
BusOut grabar
BusIn leer,0,[a]
DelayMS 15
BusIn leer,11,
DelayMS 15
BusIn leer,5,[c]
DelayMS 15
BusIn leer,15,[d]
DelayMS 15
BStop
Print At 1,1,Bin8 a
Print At 2,1,Bin8 b
Print At 3,1,Bin8 c
Print At 4,1,Bin8 d
GoTo inicio
End
TENGO ESTE PROGRAMA PARA INTENTAR LEER VARIOS REGISTROS DE CONFIGURACION PERO NADA ,AL LEER LOS VALORES ESTAN TODOS EN CERO. NO CONSIGO HACARLO FUNCIONAR. ALGUIEN PUEDE AYUDARME??????? GRACIAS