Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: Selenaut-14 on July 08, 2010, 01:45:05 PM

Title: UART confusion..?
Post by: Selenaut-14 on July 08, 2010, 01:45:05 PM
Okay, so I was thinking that an LCD would look nice on the $50 robot. I do understand that this will up the price of the robot significantly, but I don't know how to put it on. Any help? I was thinking of using the LCD here:

http://www.sparkfun.com/commerce/product_info.php?products_id=256 (http://www.sparkfun.com/commerce/product_info.php?products_id=256)
Title: Re: UART confusion..?
Post by: Razor Concepts on July 08, 2010, 02:04:31 PM
You can get a 16x2 display on ebay for like $5 shipped


It uses the popular HD44780 LCD controller, so search "avr hd44780" and there will be tons of example code (usually with instructions on pin connections)
Title: Re: UART confusion..?
Post by: Selenaut-14 on July 08, 2010, 02:22:03 PM
Okay. Thanks.
Btw, do you think the LCD will fit on the $50 robot?
Title: Re: UART confusion..?
Post by: Admin on July 08, 2010, 02:35:35 PM
The easy way is to get a serial based display, just hook up power/ground/tx (three wires, like a servo). A minute of effort.

Then use WebbotLib to program it in like 5 seconds.

done.

Of course, you could spend $10 less and spend an entire day to get it to work . . . ::)
Title: Re: UART confusion..?
Post by: Selenaut-14 on July 08, 2010, 05:05:41 PM
And do you have any idea how to do that? PLEASE, if I ever get an LCD I need to know how to this. :'(
Title: Re: UART confusion..?
Post by: Admin on July 08, 2010, 05:33:33 PM
Purchase one of these:
http://www.sparkfun.com/commerce/advanced_search_result.php?keywords=serial+lcd&x=0&y=0&search_section=products (http://www.sparkfun.com/commerce/advanced_search_result.php?keywords=serial+lcd&x=0&y=0&search_section=products)

Attach the power wire to your 5V. Attach ground to ground. And attach the Rx of the display to the Tx of your microcontroller. Done.

Then download/install WebbotLib, and read the manual about displays and the $50 Robot. It'll explain everything.
Title: Re: UART confusion..?
Post by: Selenaut-14 on July 08, 2010, 06:49:52 PM
I'm thinking about the nice one:
http://www.sparkfun.com/commerce/product_info.php?products_id=9351 (http://www.sparkfun.com/commerce/product_info.php?products_id=9351)
But i dont know if it will work with an ATmega8.
If  it can, I would be very happy.
Title: Re: UART confusion..?
Post by: SmAsH on July 08, 2010, 08:43:03 PM
It will.
Title: Re: UART confusion..?
Post by: Selenaut-14 on July 08, 2010, 09:01:12 PM
Yay! ;D
Title: Re: UART confusion..?
Post by: Conscripted on July 08, 2010, 10:50:38 PM
This was posted on the product page you linked

Additionally, all source code for the ATMega168 processor is compiled using the free WinAVR compiler and is free for downloading.

The ATMEGA168 has the same pinout as the ATMEGA8 and they speak the same language.
Title: Re: UART confusion..?
Post by: Selenaut-14 on July 08, 2010, 11:06:51 PM
One final thing to put on and I'm done: three buttons. Any way I could fit these in as a left, right, and select button for an interface? I believe I'm beginning to run out of room.

I would have:

2 servos
2 photoresistor sensors
1 RS232 Shifter board kit (see uart tutorial)
1 LCD screen
3 buttons

I haven't ordered anything yet, so if I need something larger in terms of microcontrollers I can get it. I'll just need to know how to substitute the 8 with the new one in the $50 robot circuitry.
Title: Re: UART confusion..?
Post by: Joker94 on July 08, 2010, 11:23:18 PM
yeah you will have room. the 8 has 18 digital pins that i know of and can take more than 5 ADC inputs.

2 servos will take 2 digital PWM capable pins
2 photo resistors will need 2 ADC pins
3 buttons will need 3 ADC pins
1 LCD will need the TX line.

that is 5 ADC pins and 2 digital pins and the TX pin which is also a digital pin.

so you have plenty of room to work with.
Title: Re: UART confusion..?
Post by: Selenaut-14 on July 08, 2010, 11:24:50 PM
Check again, I forgot the shifter board.
Title: Re: UART confusion..?
Post by: Selenaut-14 on July 09, 2010, 12:02:30 AM
Removing the need for two of the buttons: I could just use this:
http://www.sparkfun.com/commerce/product_info.php?products_id=9426 (http://www.sparkfun.com/commerce/product_info.php?products_id=9426)
Title: Re: UART confusion..?
Post by: Joker94 on July 09, 2010, 12:11:11 AM
well I assume your talking about a rs232 shifter board.

if so then you cant have both the LCD and the shifter board as they both need the TX line of the UART and the Atmega 8 only has 1 UART

so it will be 1 or the other. unless you use a wireless interface to communicate from your PC to the MCU over I2C e.g. something like Bluetooth.
Title: Re: UART confusion..?
Post by: Selenaut-14 on July 09, 2010, 09:41:52 PM
But I thought I needed the board in order for the LCD?
Title: Re: UART confusion..?
Post by: Razor Concepts on July 09, 2010, 10:48:24 PM
the rs232 shifter is for connecting the microcontroller to the computers serial port. you do not need it for the serial lcd
Title: Re: UART confusion..?
Post by: Selenaut-14 on July 10, 2010, 11:32:08 AM
So I can only use one at a time then.
Title: Re: UART confusion..?
Post by: Razor Concepts on July 10, 2010, 11:37:40 AM
yeah, one at a time.
Title: Re: UART confusion..?
Post by: Selenaut-14 on July 10, 2010, 01:46:14 PM
Okay. So ill mount both and ill plug in the one i need when i need it.