NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Support Forum » No serial without lcd_init();
August 29, 2012 by dan_engbers |
I fired up a project using only the serial port for communications as I required on of the AOC ports for Input Capture. When I commented out the LCD lines, to keep things clean, I ended up receiving some gibberish on the screen. I created a very simply Hello World program earlier on, so I used just that with serial and ended up with a "âXª±±½± world!" Today I found the time to try again, I uncommented the #include for lcd.h and lcd_init(); and sure enough the problem went away. If the nerdkit staff could look at this I'm sure it would be appreciated. I can try later on, but I want to get rocking on figuring out this input capture (single SIG on sensor, no interrupts used and no experience). |
---|---|
August 29, 2012 by pcbolt |
Dan - I'm not sure what you are asking here. Could you clarify a few things...
I'm not a NK staff guy, I'm just curious. Feel free to post the code you are using in this thread so it can be examined in greater detail. Screen shots might help...or a pic of the gibberish you are seeing. It might have something to do with the "Stream" functions in "C". Not sure tho. |
August 29, 2012 by dan_engbers |
Sorry, typo...ACO (Analog Comparator Output). I commented out #include "lcd.h" and then any lines that called functions from that header file. So lcd_init(); lcd_home(); etc The gibberish showed up via serial port. If you run Putty (or another terminal emulator) you can receive text via your Serial port. So the gibberish showed up in Putty for me. |
August 29, 2012 by dan_engbers |
|
August 30, 2012 by Rick_S |
The compiler is optimizing something out, turn off optimizations by changing the line in the makefile that says:
to:
(leave the micro for whichever variety you have) That is changing the dash capital letter O lower case letter s to dash capital letter O number zero. After I did this is worked as expected. Rick |
August 30, 2012 by dan_engbers |
That might solve some unexplainable issues I've been having...partially anyway. I've been using Atmel Studio 6 so I don't have a makefile, but that option was set to O1 as a default on the project. Thanks Rick. I'll test that later tonight. |
June 16, 2013 by kschallitz |
Hi guys, I hate to ask a "silly question", but this is starting to bother me... I can't seem to get serial I/O to work at all. I've used the code listed above by Dan but I get nothing output on PUTTY (COM4 115200 N81). Connecting the green / yellow wires does echo in Putty. I've confirmed the wires are connected to the correct Pins on the NerdKit (or else I wouldn't have been able to program it!). I've also tried it at both 3.6v and 5v, but neither work. Hard to ask for help on this with a general, "it's not working, help!" but, ya... it's not working. Help! If there are any more details that I can offer that would give someone the insight as to what's wrong, let me know. I somewhat suspect that it may have something to do with my makefile and the link options or something. Right now I am using Linker Flags: -mmcu=atmega328p -Wl,-u Compile options: -mmcu=atmega328p -g -O0 -Wall Hope that helps! |
June 16, 2013 by kschallitz |
Ooops Link flags got cutoff for some reason... here is the full link flags: -mmcu=atmega328p -Wl,-u,vfprintf -lprintf_flt -Wl,-u,vfscanf -lscanf_flt -lm |
June 17, 2013 by pcbolt |
kschallitz - What operation system are you using? Everything looks OK at first glance. You might try using a progam called "RealTerm" (freeware). It has quite a few options and has a screen that shows each individual wire connected to the comm port. It may help troubleshoot the problem. |
Please log in to post a reply.
Did you know that two resistors can be used to make a voltage divider? Learn more...
|