PDA

View Full Version : USBSERVICE and LCDOUT won't work together



rsocor01
- 25th October 2009, 21:45
Hi,

I am working on a touchscreen USB project where I need to see the value of some variables, so I am trying to display this data on a parallel LCD display using LCDOUT. When the LCDOUT runs the USB communication dies; otherwise, the program runs flawless. I am using 10 ms polling and a pic18f4550. I use USBSERVICE right before and after the LCDOUT command but still the USB communication dies.

Yes, I know I can display this data in my pc using VB, but I am not there yet. Does anybody knows how long LCDOUT takes to execute and why the USB connection gets disconnected?

Thank you,

Robert

Darrel Taylor
- 26th October 2009, 05:03
It's hard to say what's taking so long.
Any LCD commands take the time set by LCD_COMMANDUS.
Each character takes LCD_DATAUS.
If they are set really high, it could take a long time on a 4-line display.

But whatever they are set at, this might help with keeping USB serviced...

USB_ASM_Service.pbp
http://www.picbasic.co.uk/forum/showpost.php?p=78306&postcount=6
<br>

rsocor01
- 28th October 2009, 04:44
Darrel,

I entered the following two lines at the beginning of my program and it worked. Thank you, you are always very helpfull.


' Set command delay time in us
DEFINE LCD_COMMANDUS 2000
' Set data delay time in us
DEFINE LCD_DATAUS 50

Robert

Darrel Taylor
- 28th October 2009, 05:18
Great, that's good news.
Simple fix.

http://www.picbasic.co.uk/forum/images/icons/icon14.gif