You Are Here: Home » AVR ATmega Projects » Interfacing(USB - RS232 - I2c -ISP) Projects » Interfacing GY 26 with atmega640

Interfacing GY 26 with atmega640




Hello friend once again with new instructable in this I will show you how to interface GY 26 with UART when I started working on this very less resource where availble over internet .Thus i thought to share my piece of work
.GY 26 is a digital compass which gives angle with respect to earth north .it can be used for robot orientation and position aero model position and so on. GY26 uses UART or IIC for communication with microcontroller . communicating with GY 26 is simple and straight forward .

Interfacing GY 26 with atmega640

Step 1: Understanding UART in AVR

In AVR there are five register

1) URR-is used to set the baud rate for serial communication which is agreed by both the devices which is given by X=(F_CPU/16(desired baud rate))-1
2)USCRA-has flag of all USART interrupts
USCRB-this register is used to enable yhe interrupt
USCRC-this is the control register which is used toset the mode synchronous or asynchronous ,parity bits,stop bits,character size and clock polarity.
3)UDR-data registor

the timing is very critical issue check the frequency at which your board is running

here is a site for USART
http://newbiehack.com/USARTDetailed.aspx

 

Leave a Comment

You must be logged in to post a comment.

Read previous post:
New Horizons completes record-setting Kuiper Belt targeting maneuvers

NASA's New Horizons spacecraft has successfully performed the last in a series of four targeting maneuvers that set it on...

Close
Scroll to top