# Atmega162 Serial Communication

**URL:** <https://community.sparkfun.com/t/atmega162-serial-communication/30255>\
**Category:** MicroMod\
**Tags:** avr-atmel\
**Created:** [January 28, 2015, 6:07pm UTC](https://community.sparkfun.com/t/atmega162-serial-communication/30255 "2015-01-28T18:07:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ameya](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@Ameya](https://community.sparkfun.com/u/Ameya)\
**Post date:** [January 28, 2015, 6:07pm UTC](https://community.sparkfun.com/t/atmega162-serial-communication/30255/1 "2015-01-28T18:07:46Z")

</div>

I had a doubt regarding serial communication of Atmega 162

Can any one help please??

I have initialized the USART by setting bits in UCSRB and UCSRC and passed a value in UDR register…but not able to see anything on Serial port of my PC

I am using 8 bit frame with 1 stop bit.

I have written a simple code shown below.

Please help

#include \<avr/io.h\>

#include \<util/delay.h\>

#define F\_CPU 10000000

#define BAUD 9600

#define UBRR ((F\_CPU/16UL/BAUD)-1)

int main(void)

{

UBRR0H = (UBRR \>\>8);

UBRR0L = UBRR;

UCSR0B = (0\<\<UCSZ02) | (1\<\<TXEN0);

UCSR0C = (1\<\<UCSZ01) | (1\<\<UCSZ00) | (1\<\<URSEL0) | (0\<\<UMSEL0) | (0\<\<USBS0);

while(1)

{

UDR0 = 0X55;

\_delay\_ms(100);

}

}

---

<div class="post-metadata">

**Author:** ![stevech](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@stevech](https://community.sparkfun.com/u/stevech)\
**Post date:** [January 29, 2015, 5:54am UTC](https://community.sparkfun.com/t/atmega162-serial-communication/30255/2 "2015-01-29T05:54:26Z")

</div>

why not start with a working example?

---

<div class="post-metadata">

**Author:** ![Ameya](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@Ameya](https://community.sparkfun.com/u/Ameya)\
**Post date:** [January 29, 2015, 3:15pm UTC](https://community.sparkfun.com/t/atmega162-serial-communication/30255/3 "2015-01-29T15:15:23Z")

</div>

@stevech, Can you please suggest me any working example to start with??

---

<div class="post-metadata">

**Author:** ![Ross\_Robotics](https://avatars.discourse-cdn.com/v4/letter/r/cc9497/32.png) [@Ross\_Robotics](https://community.sparkfun.com/u/Ross_Robotics)\
**Post date:** [January 29, 2015, 3:27pm UTC](https://community.sparkfun.com/t/atmega162-serial-communication/30255/4 "2015-01-29T15:27:58Z")

</div>

First link on a Google search: [http://www.avrfreaks.net/forum/newbie-a … on-problem](http://www.avrfreaks.net/forum/newbie-atmega162-usart-serial-communication-problem)

I just searched your title…

It’s amazing how many people that don’t know how to search…

---

<div class="post-metadata">

**Author:** ![skimask](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@skimask](https://community.sparkfun.com/u/skimask)\
**Post date:** [January 29, 2015, 8:04pm UTC](https://community.sparkfun.com/t/atmega162-serial-communication/30255/5 "2015-01-29T20:04:48Z")

</div>

> codlink:  
> First link on a Google search: [http://www.avrfreaks.net/forum/newbie-a … on-problem](http://www.avrfreaks.net/forum/newbie-atmega162-usart-serial-communication-problem)
> 
> I just searched your title…
> 
> It’s amazing how many people that don’t know how to search…

Amazing?

Or appalling?

---

<div class="post-metadata">

**Author:** ![Ross\_Robotics](https://avatars.discourse-cdn.com/v4/letter/r/cc9497/32.png) [@Ross\_Robotics](https://community.sparkfun.com/u/Ross_Robotics)\
**Post date:** [January 30, 2015, 12:04am UTC](https://community.sparkfun.com/t/atmega162-serial-communication/30255/6 "2015-01-30T00:04:06Z")

</div>

I used amazing to be somewhat respectful… But appalling would be a good one.
