NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Support Forum » comminicating thru uart

June 02, 2009
by HarmVeenstra
HarmVeenstra's Avatar

comminicating thru uart

using the following code I can send a string to my PC running Hyperterm (115200,N,8,1)

// start up the serial port
uart_init();
FILE uart_str = FDEV_SETUP_STREAM(uart_putchar, uart_getchar, _FDEV_SETUP_RW);
stdin = stdout = &uart_stream;
printf_P(PSTR("hallo"));

but I can't seem to figure out how to read text back that I type in Hyperterm.

Do I need to read 1 char at a time, or can I receive an entire string ?

June 04, 2009
by Starwarslegokid
Starwarslegokid's Avatar

Hi HarmVeenstra,

Take a look at the servo guided water squirter tutorial, It shows how you can make the microcontoller do different things by what key is pressed. It waits for a message to be reciceved and then stores it into a variable that you read. I thinking you will have to do it one char at a time, every time you press a key that message is sent to the controller so to type a word, it be allot of messages.

Hope this helps B-) Scott

June 04, 2009
by HarmVeenstra
HarmVeenstra's Avatar

Thanks for the tip. I found out that my code was OK. The problem is that Micorsoft's HyperTerm is a pice of cr*p! I now use a differnt terminal program, one that was designed to be used with microcontrollers.

June 04, 2009
by Starwarslegokid
Starwarslegokid's Avatar

What terminal are you using?

June 07, 2009
by HarmVeenstra
HarmVeenstra's Avatar

Sorry for the late reply.

http://hw-server.com/software/termv19b.html

Download it from there, because the link to the homepage doesn't work.

Rgds.

June 09, 2009
by Starwarslegokid
Starwarslegokid's Avatar

Thanks for posting the link, I like the terminal allot more than the hyper terminal, it works very nice B-)

Thanks again!

Scott B-)

Post a Reply

Please log in to post a reply.

Did you know that you can control multiple LEDs from one microcontroller output? Learn more...