# Newbie help with RS232 Tutorial

**URL:** <https://community.sparkfun.com/t/newbie-help-with-rs232-tutorial/8595>\
**Category:** MicroMod\
**Tags:** avr-atmel\
**Created:** [September 28, 2008, 2:17am UTC](https://community.sparkfun.com/t/newbie-help-with-rs232-tutorial/8595 "2008-09-28T02:17:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tonys](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@tonys](https://community.sparkfun.com/u/tonys)\
**Post date:** [September 28, 2008, 2:17am UTC](https://community.sparkfun.com/t/newbie-help-with-rs232-tutorial/8595/1 "2008-09-28T02:17:30Z")

</div>

Hi I’m up to this part of the tutorial:

[http://www.sparkfun.com/commerce/tutori … als\_id=105](http://www.sparkfun.com/commerce/tutorial_info.php?tutorials_id=105)

I’ve set the fuse bits for a 16Mhz crystal on my ATMega168. I’m still not sure what SUT\_CKSEL to pick, so I picked the very last one on the list. I got the RS232 shifter board and it seems to be working fine, when I tie RX and TX the keyboard echoes correctly to TeraTerm. But the program in the tutorial doesn’t work, when I run it, all it does is print boxes, which I’m guessing means an unknown character or it didn’t receive it correctly. Does anyone know how to make it print correctly, or what I might be doing wrong? Here is the code of the tutorial.

[http://www.sparkfun.com/tutorial/Beginn … ega168.zip](http://www.sparkfun.com/tutorial/BeginningEmbedded/5-Compiling/basic-out-atmega168.zip)

Thanks!

---

<div class="post-metadata">

**Author:** ![tlynch99](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@tlynch99](https://community.sparkfun.com/u/tlynch99)\
**Post date:** [September 29, 2008, 12:49am UTC](https://community.sparkfun.com/t/newbie-help-with-rs232-tutorial/8595/2 "2008-09-29T00:49:33Z")

</div>

I am interested in learning about this as well. I am having a similar problem. Everything work with regards to the loop backs etc… but when I try and run the program all I get is “…”. I think it may have something to do with the baud rate not being correct, but I am not sure.

---

<div class="post-metadata">

**Author:** ![tonys](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@tonys](https://community.sparkfun.com/u/tonys)\
**Post date:** [September 29, 2008, 1:31am UTC](https://community.sparkfun.com/t/newbie-help-with-rs232-tutorial/8595/3 "2008-09-29T01:31:39Z")

</div>

Wow I just fixed it now. I’m using AVR Studio. First I picked the last SUT\_CKSEL on the list “Ext Crystal Osc 8.0-”. Then this is what fixed it: make sure to uncheck CKDIV8. That tutorial needs to be updated and more specific. The final fuse values should be EXTENDED=0xF9, HIGH=0xDF, LOW=0xBF. I can finally get on to other stuff! 🙂

---

<div class="post-metadata">

**Author:** ![EricAtPobot](https://avatars.discourse-cdn.com/v4/letter/e/bc8723/32.png) [@EricAtPobot](https://community.sparkfun.com/u/EricAtPobot)\
**Post date:** [November 16, 2008, 4:49pm UTC](https://community.sparkfun.com/t/newbie-help-with-rs232-tutorial/8595/4 "2008-11-16T16:49:48Z")

</div>

As you may have guessed, the CKDIV8 flag divides the clock by 8, so the frequency at which the proc is running is no more the crystal one, but 1 MHz if your crystal is a 8MHz one. The baud rates generation is thus no more correct (at least if you have not configured them for a 1 MHz clock).

---

<div class="post-metadata">

**Author:** ![signal7](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@signal7](https://community.sparkfun.com/u/signal7)\
**Post date:** [November 20, 2008, 4:42pm UTC](https://community.sparkfun.com/t/newbie-help-with-rs232-tutorial/8595/5 "2008-11-20T16:42:30Z")

</div>

Personally, if I’m doing anything time critical, I will set the clock prescaler in software right after I set up the stack. The fuse bits on all of the atmel parts I’ve used just set the initial prescaler value. Software can then successfully set the prescaler to known value and you don’t have to worry about whether or not the fuse bits are programmed right.
