Yes, the LDC is working just fine. The baud rate is the standard MIDI baud rate. I'm trying to make a MIDI controller.
I've updated the code with the suggestions and made it a little more simple. I'm trying to get the LCD of the receiving PIC to display "1" for 300ms and then "0" for 300ms.
Here's the code for the transmitting PIC:
Code:
define OSC 20
define HSER_RCSTA 90h
define HSER_TXSTA 20h
define HSER_BAUD 31250
ANSEL = %00000000
ANSELH = %00000000
TRISD = %00000000
TRISE = %00000000
TRISA = %00000000
TRISB = %00000000
TRISC = %10000000
main:
hserout [1]
PORTA.0 = 1
pause 300
hserout [0]
PORTA.0 = 0
pause 300
goto main
Here's the code for the receiving PIC:
Code:
CLEAR
define LOADER_USED 1
define OSC 20
define HSER_RCSTA 90h
define HSER_TXSTA 20h
define HSER_BAUD 31250
define HSER_CLROERR 1
define LCD_DREG PORTD
define LCD_DBIT 0
define LCD_RSREG PORTE
define LCD_RSBIT 0
define LCD_EREG PORTE
define LCD_EBIT 1
define LCD_RWREG PORTE
define LCD_RWBIT 2
define LCD_BITS 4
define LCD_LINES 4
define LCD_COMMANDUS 2000
define LCD_DATAUS 50
ANSEL = %00000000
ANSELH = %00000000
TRISD = %00000000
TRISE = %00000000
TRISA = %00000000
TRISB = %00000000
TRISC = %10000000
character var byte
pause 250
lcdout $FE, 1
lcdout $fe, $d4, "ready to receive"
pause 500
lcdout $fe, 1
pause 250
main:
hserin [character]
lcdout $fe, 1
lcdout $fe, $94, character
goto main
It's still not working.
Bookmarks