Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Electrical (http://www.chiefdelphi.com/forums/forumdisplay.php?f=53)
-   -   Interfacing with LCD to debug (http://www.chiefdelphi.com/forums/showthread.php?t=60939)

keen101 07-01-2008 10:25

Interfacing with LCD to debug
 
Quote:

Originally Posted by keen101 (Post 669547)
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.


Quote:

Originally Posted by Kevin Watson (Post 669563)
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

Re: Interfacing with LCD to debug
 
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.

keen101 07-01-2008 12:25

Re: Interfacing with LCD to debug
 
Thank you. That may come in very handy.

Mark McLeod 07-01-2008 12:35

Re: Interfacing with LCD to debug
 
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.

keen101 07-01-2008 12:39

Re: Interfacing with LCD to debug
 
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

robbrad 07-01-2008 17:13

Re: Interfacing with LCD to debug
 
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.

ay2b 07-01-2008 19:31

Re: Interfacing with LCD to debug
 
Spark Fun Electronics has a bunch of LCDs available. If you look for the ones labeled "serial enabled", 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.

robbrad 07-01-2008 20:51

Re: Interfacing with LCD to debug
 
Have you successfully changed the splash screen on one of SparkFun's serial LCDs?

keen101 07-01-2008 23:41

Re: Interfacing with LCD to debug
 
Ok, I think I am going to either get this one

http://www.allelectronics.com/cgi-bi...W-GREEN)_.html

or this one

http://www.allelectronics.com/cgi-bi...ACKLIGHT_.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.

tseres 08-01-2008 19:01

Re: Interfacing with LCD to debug
 
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?

ay2b 08-01-2008 19:59

Re: Interfacing with LCD to debug
 
Quote:

Originally Posted by tseres (Post 672669)
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.

tseres 08-01-2008 20:24

Re: Interfacing with LCD to debug
 
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)?

keen101 18-01-2008 01:29

Re: Interfacing with LCD to debug
 
1 Attachment(s)
Where do I wire up the TX and RX lines of the TTL port to the LCD?

ay2b 18-01-2008 02:00

Re: Interfacing with LCD to debug
 
Quote:

Originally Posted by keen101 (Post 680617)
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.

keen101 18-01-2008 12:58

Re: Interfacing with LCD to debug
 
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

Re: Interfacing with LCD to debug
 
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 (LCD, interface, and co-processor) solution similar to what AdamBots (245) did in 2007.


All times are GMT -5. The time now is 21:56.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi