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 .
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.
the timing is very critical issue check the frequency at which your board is running
here is a site for USART
Leave a Comment
You must be logged in to post a comment.