NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Microcontroller Programming » Send number via UART from PC to MCU
December 29, 2012 by lnino |
Hi at all. After some long time I am back with a new project. Maybe someone can help me to realise it. I want to send an UART command via Hyper Terminal, or putty, or a small c# application. The command can be a simple number like 1. On the MCU I want to catch this command and write into the EEPROM. After that I want to check if the command is 1. If it is an LED should blink. I wrote a short code which might can do this. Will it? Or is there something missing? Until now it was quite easy. Hopefully my code isn't totally crap. But how can I send the UART command from my PC via HyperTerminal, putty or small c# programm? This is just a small simple program for understanding EEPROM and UART better. Thanks for the support.
|
---|---|
December 29, 2012 by Ralphxyz |
Hi Innio, nice to see you again. Have you looked at the Servo Squirter Project lately? Humberto is hitting a key on the pc keyboard to control the servo, is that what you would like to do? That is, you could type a 1 to get your mcu process started. Why are you writing to the EEPROM and doing your action? You could just do your action. Ralph |
December 29, 2012 by lnino |
Hi Ralph, thanks for your reply. I will have a Look at the servo Project. It Sounds like that could be a solution. The reason for writing to the eeprom is for testing purpose. I will do a Bigger Project where you can Enter a Text through uart. The Text will be displayed in a 7 Segment digit. To Save the Text After powering off i will write it into eeprom. I will make some tries and let you know about the Result. |
December 29, 2012 by Ralphxyz |
Yeah I thought you had a reason, go for it :-) Ralph |
December 29, 2012 by pcbolt |
Innio - Just keep in mind while you are testing that the call to "uart_read()" will block execution until something arrives at the UART port. For what you are doing this should be OK. For more complicated programs you could try using UART interrupts if need arises. |
Please log in to post a reply.
Did you know that our USB NerdKit comes with everything you need to get started with microcontrollers? Learn more...
|