ATMege164P Bit setting help

Discussions on the software and hardware for Atmel's STK standard.

Moderator: phalanx

Post Reply
spartan09
Posts: 2
Joined: Tue Nov 25, 2014 10:00 am

ATMege164P Bit setting help

Post by spartan09 » Tue Nov 25, 2014 10:24 am

Hello, I have a AVR question i need help answering. NOTE: I AM NOT ASKING YOU TO GIVE ME THE ANSWER!! I am new to AVR Microcontrollers and would appreciate some help. I have included my answers.

An AVR is running from an 11.0592MHz clock. For serial transmission only, at 4800 Baud:

Which bit(s) in the UCSR0B need to be set?

What value needs to be loaded into the UBRR0 register? (Assume U2X0 = 0.)

----ATMega164p----



My Answer:

From the data sheet I would set bits: 1<<TXCIEn | 1<< TXEn | 1<<TXB8n

The values that need to be loaded into the UBRR0 register are:

UBRR0 = ( f / (16XBaud Rate)) -1
UBRR0 = 143

So values 143 needs to be loaded into the register


Can someone who is familiar with micro controllers confirm my answers as I am new to this. If they are wrong could you please correct me. much appreciated

Thanks

stevech
Support Volunteer
Posts: 2907
Joined: Sat Jun 05, 2004 8:51 pm
Location: USA, California

Re: ATMege164P Bit setting help

Post by stevech » Fri Nov 28, 2014 1:32 am

Use an on-screen crib sheet:
Google search "AVR calc"

Post Reply