Comunicacion Serial Entre Pics
Enviado por LENOLEINS • 14 de Enero de 2014 • 260 Palabras (2 Páginas) • 247 Visitas
SEROUT
INCLUDE "modedefs.bas"
TRISB = 0
TRANS VAR WORD
TRANS = 255
PAUSE 100
SEROUT PORTB.0,N9600,[TRANS]
PAUSE 100
--------------------------------------------------------------------------------------
SERIN
INCLUDE "modedefs.bas"
TRISD = %11111111
TRISB = %11111111
TRANS VAR WORD
DEFINE LCD_DREG PORTD ' Set LCD Data port
DEFINE LCD_DBIT 4 ' Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_RSREG PORTD ' Set LCD Register Select port
DEFINE LCD_RSBIT 0 ' Set LCD Register Select bit (RS)
DEFINE LCD_EREG PORTD ' Set LCD Enable port
DEFINE LCD_EBIT 1 ' Set LCD Enable bit (E)
DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
DEFINE LCD_LINES 2 ' Set number of lines on LCD
DEFINE LCD_COMMANDUS 2000 ' Set command delay time in us
DEFINE LCD_DATAUS 50 ' Set data delay time in us
Lcdout $fe, 1 ' Clear LCD screen
Lcdout "YA JUNCIONA: "
PAUSE 100
SERIN PORTB.1,N9600,TRANS
PAUSE 100
LCDOUT dec TRANS
END
...