Ryan,
Serial to Parallel LCD is one of the easiest things you can do with a PIC. But you're making it harder than it needs to be.
All of the initialization of the LCD is handled by PicBasic Pro. You don't need all that stuff in-between Main: and goto main2.
Simple initialization...Next, you are sending ASCII numbers from the BS2, so they are ready to display. Converting the ASCII to a WORD, then converting the WORD back to ASCII is counter productive and just waists time that you need since the data is comming in faster than it can do the conversions.Code:LCDOUT $FE, 1 PAUSE 500
Also, by converting to words, it eliminates the possibility of sending Commands, which you'll need to do, to move the curson to where you want to put the text.
All you really need to do is receive 1 byte at a time, and pass it on to the LCDOUT command.While that will get you closer to what you want, you really should use the USART with HSERIN. There's not much time between incomming characters, and if they are sent too fast from the BS2 (can't imagine a BS2 being FAST), you might miss a character. If that happens you can add some CHAR Pacing on the BS2 to slow things down a bit. But if you use HSERIN, you won't have to worry about it.Code:LCDloop: SERIN2 PORTB.0, 16780, [INbyte] LCDOUT INbyte GOTO LCDloop
For the USART, you don't need a MAX232, just make the BS2 send RS232 in TRUE mode, instead of inverted.




Bookmarks