I tried changing wait times and serial speed and still does not work.
Here is the offending code:
'------------------------------------------------------------------------------
'Initial config
'------------------------------------------------------------------------------
DEFINE OSC 20 'Osc 20MHz
DEFINE NO_CLRWDT 1 'WDT inactive
'------------------------------------------------------------------------------
'Port definition
'------------------------------------------------------------------------------
SCL3W VAR PortA.0 'Puerto de reloj del RTC (3 wire)
IO3W VAR PortA.1 'Puerto de datos del RTC (3 wire)
RST3W VAR PortA.2 'Puerto de reset del RTC (3 wire)
TXLCD VAR PortA.3 'Puerto de TX del LCD
MCLRLCD VAR PortA.5 'Puerto de reset del LCD
RARROW VAR PortB.0 'Boton a la derecha
UARROW VAR PortB.1 'Boton hacia arriba
DARROW VAR PortB.2 'Boton hacia abajo
LARROW VAR PortB.3 'Boton a la izquierda
TXPRTR VAR PortB.4 'Puerto serie asinc. para impresora TX
RXPRTR VAR PortB.5 'Puerto serie asinc. para impresora RX
KSWITCH VAR PortB.6 'Llave
ACDETECT VAR PortB.7 'Deteccion de AC
EE1 VAR PortC.0 'Habilita memoria EEPROM principal
EE2 VAR PortC.1 'Habilita memoria EEPROM secundaria
IROUT VAR PortC.2 'Salida serial IR
SCLI2C VAR PortC.3 'Puerto de reloj I2C para EEPROMs
SDAI2C VAR PortC.4 'Puerto de datos I2C para EEPROMs
IRIN VAR PortC.5 'Entrada serial de IR
TXPC VAR PortC.6 'Puerto serie asinc. para PC TX (impresora 2)
RXPC VAR PortC.7 'Puerto serie asinc. para PC RX (impresora 2)
main:
'+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++
'Initialize PIC hardware
'+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++
Init_Hardware:
ASM
movlw B'00111111'
movwf ADCON1 ;Port A is digital I/O
clrf PORTA ;Clear port A data latches
clrf PORTB ;Clear port B data latches
bsf PORTB,4 ;Printer port initial state
clrf PORTC ;Clear port C data latches
bsf PORTC,3 ;Initial state of RC3 (SCL)
bcf INTCON2,RBPU ;Enable pull-ups on port B
movlw B'00010010' ;RA1 & RA4 inputs
movwf TRISA ;
movlw B'11101111' ;RB4 output
movwf TRISB ;
movlw B'10110011' ;RC2 & RC3 outputs, RC6 & RC7 serial port
movwf TRISC ;(TX y RX)
ENDASM
'+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++
'Initialize LCD
'+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++
Init_LCD:
PAUSE 1000 'Wait for everything to power up
TXLCD=1 'Initial State of LCD comm line
MCLRLCD=1 'Enable LCD
PAUSE 100 'Wait 100ms for LCD to startup
SEROUT2 TXLCD,84,["U"] 'Send a "U" to sync comm speed
PAUSE 60
SEROUT2 TXLCD,84,[$01] 'Clear LCD
PAUSE 5
SEROUT2 TXLCD,84,[$0C] 'Turn off insertion point
PAUSE 5
SEROUT2 TXLCD,84,["Control de Impr."]
PAUSE 10
SEROUT2 TXLCD,84,[$00,$40,"v 5.0b"]
PAUSE 5000 'Display initial message for 5 seconds
SEROUT2 TXLCD,84,[$01] 'Clear LCD
PAUSE 50
'+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++
END
Bookmarks