NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Basic Electronics » Help with reading UART Stream on mac
August 18, 2013 by Affarram |
In the Temperature Sensor project it says: "The last line uses printf_P() to write a line to stdout, which you remember we mapped to the UART stream which writes data to the serial connection. If you wanted to you could connect your computer and read the temperature from your computer. The printf and fprintf functions are very powerful, and you can find information about in our printf/scanf tutorial on our website." I watched the video on this topic and understand how to use printf/scanf. I have loaded the C code into Xcode and it works great when testing my code in the console. But, I am having trouble figuring out how to use my micro controller and have it display things in terminal on my mac like was shown in the "C Programming: The printf and scanf Family of Functions" tutorial. If anyone can help I would appreciate it. Thank You Sean |
---|---|
August 19, 2013 by Ralphxyz |
Seems like I post a how-to here in the forum oh wait I posted it in the Nerdkits Library. I gave up on using my MAC after Apple once again abandoned it's legacy (2 years old or more) users. But I'll try to remember how to do that, maybe Google will get you there that is how I figured it out. Ralph |
August 19, 2013 by Affarram |
Ralph, Thanks for the response. My first thought was to look in the library but it doesn't seem to be working. I searched the forums for a bit and was unable to find the answer. I hate to ask a question if it has been posed many times. I will continue to search the web until I figure this out. Sean |
August 19, 2013 by Noter |
You need a serial port terminal program that runs on your mac to see ascii data from the serial line that connects your micro controller. |
August 20, 2013 by Ralphxyz |
"You need a serial port terminal program" That is built-in on the MAC, I just cannot remember how to use it. Ralph |
August 20, 2013 by Ralphxyz |
Ah here ya go, a simple google of Mac serial?. You use the "screen" command!! Seems like I had to do certain things when screen hung I'll have to check my notes, if I could find them. Ralph |
August 20, 2013 by Affarram |
Thanks. This should be enough for me to figure out the rest. |
August 27, 2013 by Affarram |
Ok, so. I have looked into using the "screen" command and I must be doing something wrong. I compiled this code to my micro controller:
Then when i reset my nerdkit the LCD is blank. I then use terminal to connect to my nerdkit by typing
or
They both give me the same result. My nerdkit's LCD then displays
And in terminal I get
and anything I type is more gibberish. Any Ideas on what I can try? |
August 27, 2013 by Affarram |
So I discovered something called a 'Baud Rate' after a few hours of watching youtube videos. I then looked in the uart.c file and found that the baud rate is set to 115200bps with 14.7456MHz clock. In terminal I typed
now I get
so I seem to have found my solution. |
Please log in to post a reply.
Did you know that you can connect to certain car computers via the OBD-II port with a microcontroller? Learn more...
|