Beginners: please read this post and this post before posting to the forum.
0 Members and 1 Guest are viewing this topic.
I sympathize... Getting started with this sort of thing is tricky when all of the hardware/software is new, and anything could be an issue... I'll throw a couple ideas out there for you.I've not used the breakout board that you mentioned. What I have used for what you're trying to do are this and this (separately of course). As best I can tell, for what you're doing, these three boards should be interchangeable. *shrug*Are you setting up the same baud rate between your atmega 328p and hyperterminal?What about a loopback test? Connect RX to TX on the USB/serial adapter and you should then see what you type echoed back at you in Hyperterminal.
Funky characters are usually due to differing baud rates. Hyperterminal and your code for your MCU's UART need to have the same baud rate.
Regarding level converters, I'm pretty sure the sparkfun board can handled 5V... but the 3.3V terminal on it made me wonder, too...I've not built an MCU starting from the actual Atmega chip. Is it possible you have the timing wrong with a crystal or something? That would mess up the baud rate... Perhaps do a test where the LED goes on for 1 second, off for 1 second, over and over. Then see if it's actually timing correctly?Also, what's the code (just the print statement, probably) you're using to send Hello World out the UART?
The board I am using is one of the choices, the 328P,
Quote from: ErikY on July 25, 2012, 11:55:23 AMThe board I am using is one of the choices, the 328P,There isn't a board called the 328P. There are many that use that chip: Roboduino, various $50 robots, Orangutans etc. Which are you using?
I am using my $50 robot board that I built, which I upgraded to the 328p.
Quote from: ErikY on July 25, 2012, 05:12:51 PMI am using my $50 robot board that I built, which I upgraded to the 328p.Still not clear. Are you using a board design that came with Project Designer (maybe '$50 ATMega328P 1MHz' or '$50 ATMega328P 8Mhz' I guess?). Or have you 'built' one in Board Designer? Please state the exact name of the board you are using in Project Designer or whether you have create your own Board Design.
Ok - so next step is to see your code and Project. May sound strange - but by default stdout etc are just thrown away unless you have specified where they go to (ie a UART, an LCD, or anything else that can be written to). Bear with me. By sending me your Project file (.prj) then I can see what options you choose during codegen.ZIP up your entire project folder (ie your Project Designer project which ends in .prj and your code) and send it to me
edit - hit some button before I meant to...After a quick look (so I could be wrong) - when you do the codegen (ie Tools | Generate) in Project Designer then it looks like the first 2 drop downs are blank.....'Send rprintf output to' is where your rprintf goes to (as used in your code). Since its blank then your output gets binned.'Send error output to' is worth setting to a uart to a Pc if one exists. WebbotLib can then report errors rathe than trying to flash the status LED.
other fuse that is referenced in the UART tutorial
Changing the CKDiv8 fuse via say, your AVRISP mkii+AVRStudio, changes the chip from working at 1MHz or at 8MHz - thats part of 'hardware setup'.WebbotLib is just a software library - it doesn't do anything with fuses or other hardware settings. But you do need to tell it if your chip is configured to run at 1MHz or 8MHz and you do that by choosing the appropriate Board for your project.Not sure what the Quoteother fuse that is referenced in the UART tutorial is. Are you referring to something in Admins tutorial? Send me a link and I'll have a look.Believe me - WebbotLib can control UARTs - otherwise I would have zero users! So just hang in there
#define F_CPU 8000000 // 8MHz processor
Ok, thanks, the two fuses are purely to do with what speed the processor runs at - ie nothing 'uart' orientated.So if you set the fuses to whatever you want - say to 8Mhz as per the tutorial then just use the $50 8 MHz board.That tutorial also talks about setting F_CPUQuote#define F_CPU 8000000 // 8MHz processor - DO NOT DO THIS WITH WEBBOTLIB. The board design sets the processor speed so NEVER try to change it in your own code.I think part of the confusion is that you MAY be combining tutorials from societyofrobots (ie Admins own library) with stuff from webbot (my completely different library). We are different people/websites/etc - and our code is different and completely unrelated!