View Full Version : Interfacing with LCD to debug
I am interested in possibly using an LCD for real time "debugging"/errors
Is this possible/feasible? Would we have to "steal" the old camera TTL port?
i know Kevin Watson mentioned interfacing an LCD on his website briefly, but i think he meant it as kind of a joke.
With regard to LCDs, I've used the seetron.com text displays and the earthlcd.com graphical displays on various 'bots over the past few years.
-Kevin
OK, I'm still very interested in this. I would like to know:
1. HOW to interface an LCD to the robot. (TTL port?) I really need to know how to wire it to the robot.
2. how to talk to the LCD in programming.
*note that I'm not a programmer, but I can relay the information to our team programmer. So, an idea or some sample code would be helpful.
Mark McLeod
07-01-2008, 12:21
Here's a demo example we used on a Vex robot a couple of year's ago: http://team358.org/files/programming/Vex_LCD_Demo.zip
The particular LCD we used was wired to digital input 16 and didn't use either serial port. It was a lesson on the basics of serial communication.
The README.txt file talks about the communication.
We used a Scott Edwards Electronics, Inc.
BPP-420 is an LCD module with attached serial interface. The spec. is in the zip file.
Thank you. That may come in very handy.
Mark McLeod
07-01-2008, 12:35
Sorry, I had to add a P.S. to my post.
The example was used as a lesson on the basics of serial communication and didn't use either serial port. It used a single digital output pin to transmit serial data to the LCD module.
If you use the TTL port instead then you can take advantage of the built-in serial support.
Yes, since there is no camera this year. (or at least no camera is really needed to track a green light) Then, I am thinking about "stealing" the port and use it for a cool LCD. Hopefully we can come up with a neat way to display errors, for real time debugging. But, it could at least display our team number. :D
I'm not too familiar with the processor in the RC but I use USART for my hobby projects. I just send a string to a for loop and it transmits at a specific baud rate.
Spark Fun Electronics (www.sparkfun.com) has a bunch of LCDs available (http://www.sparkfun.com/commerce/categories.php?cPath=76). If you look for the ones labeled "serial enabled (http://www.sparkfun.com/commerce/advanced_search_result.php?keywords=serial+enabled +lcd&x=0&y=0)", then it is trivial to connect them to the FRC controller, or a Vex controller. Then you just use the "print()" function (making sure it goes to the right serial port) and whatever you print out shows up on the controller. There are a few escape sequences you can print to do things like clear the screen or move the cursor around.
Have you successfully changed the splash screen on one of SparkFun's serial LCDs?
Ok, I think I am going to either get this one
http://www.allelectronics.com/cgi-bin/item/LCD-120/365/16_X_2_LCD_W__LED_BACKLIGHT_(YELLOW-GREEN)_.html
or this one
http://www.allelectronics.com/cgi-bin/item/LCD-124/365/16_X_2_LCD_DISPLAY_W__LED_BACKLIGHT_.html
Does anyone know how to wire it up? I have no idea which pins go where. This is my first time working with LCD's. Now that I have chosen a specific model I'm hoping someone can help me out.
i have a more general question...how can i write and send a text command to the built in TTL port on the rc? without going into detail, a GPS reciever using the standard NMEA protocol accepts TTL ASCII text strings as commands, and sends the serial amswers back...how would i go about reading and writing from the TTL port like this, or at least use a digital pin to do this?
i have a more general question...how can i write and send a text command to the built in TTL port on the rc? without going into detail, a GPS reciever using the standard NMEA protocol accepts TTL ASCII text strings as commands, and sends the serial amswers back...how would i go about reading and writing from the TTL port like this, or at least use a digital pin to do this?
This depends on your code. If you are using Kevin's serial_port.c/h library, then the instructions are in the file. Basically make sure you have ENABLE_SERIAL_PORT_TWO_TX defined for writing and ENABLE_SERIAL_PORT_TWO_RX defined for reading, and have the appropriate baud rate set. Then you set the global variable "stdout_serial_port" to the value of "SERIAL_PORT_TWO". After that, any printf() will go to the TTL line instead of the debug line. Please note, however, that it's possible I'm getting ports ONE and TWO mixed up.
thanks! that really helps a lot!
also, does that send to the TTL port that the CMU cam uses? or does it send to the porgram port (rs232)?
Where do I wire up the TX and RX lines of the TTL port to the LCD?
Where do I wire up the TX and RX lines of the TTL port to the LCD?
Based on the diagram, that LCD is not compatible with the TTL port. The diagram shows it wired to a "printer port", which is a parallel interface. The TTL port is a serial port. (It may be possible that the LCD also has a serial interface, not shown in this diagram.)
A byte consists of 8 bits. A parallel interface uses 8 pins and sends all bits at the same time (plus some control pins). A serial interface uses 1 pin and sends each bit in sequence.
You could still use the RC to control this LCD, but you would have to use the digital I/O pins, not the TTL port.
I'm pretty sure it has serial capabilities too. I will try and find the serial diagram when I can. But, I would like to know how to use the digital I/O pins too. how would i wire that up?
jtdowney
18-01-2008, 13:13
Precision Guessworks (1646) has a touchscreen LCD on the way along with our co-processor. The goal is to use it for diagnostics and debugging. We went with a Gumstix (http://gumstix.com) (LCD (http://gumstix.com/store/catalog/product_info.php?cPath=28&products_id=195), interface (http://gumstix.com/store/catalog/product_info.php?cPath=31&products_id=196), and co-processor (http://gumstix.com/store/catalog/product_info.php?cPath=27&products_id=182)) solution similar to what AdamBots (245) did in 2007.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.