Monday, September 28, 2015

Getting data from ADXL345 From USART - ATmega32




A small update on Interfacing ADXL345 with ATmega32, this program will get raw data from ADXL345 working on I2C mode and send the data over USART.

To recieve data to PC over USART see this.

Saturday, September 26, 2015

AVR Dude


AVRDUDE is an excellent program for programming a AVR Atmega series microcontroller. In order to program any microcontroller you need to have a *.hex file which contain the instructions for the microcontroller. Apart from the software you need to have a hardware connection between your PC and the microcontroller which acts as an interface to write the *.hex file into the memory of the microcontroller, from where it run the instuctions in the specified *.hex file. USBasp is an awesome programmer found at cheap cost on almost all online stores these days. So you need a programmer like USBasp, some basic circuit for the ATmega and a PC with AVRDUDE and *.hex file to start the programming the microcontroller.

Wednesday, January 15, 2014

OpenFOAM - blockMesh

Please read OpenFOAM - Basics before reading this post

blockMesh is a mesh generation utility supplied with OpenFOAM. In simple word it generates mesh for the CFD analysis. In the last post it was said that the basic OpenFOAM case directory consists of three folders namely 0, constant and system. The blockMeshDict file in the constant/polyMesh directory of the case file contains the parameter of the geometry and the parameters required for meshing the surface. Now go to the forwardStep directory which is discussed in the previous post and open the blockMeshDict file. In the file u scan see may sections like FoamFile, vertices, blocks, edges, etc.,

Sunday, January 12, 2014

Advanced USART Functions


In the previous post the USART_Transmit_char function can only send one character at a time. If you want to send a whole sentence or an integer or a non-integer you cant use the above function. Here are some code snippets that come in handy while using USART.

Sunday, October 20, 2013

USART with ATmega32

Introduction

The Universal Synchronous and Asynchronous serial Receiver and Transmitter (USART) is a highly flexible serial communication device. It is the easiest way to communicate with a computer. Many softwares such as MATLAB, Scilab, Mathmatica, etc., provide libraries that support serial communication. Real time data logging can be easily done due to its speed and flexibility in features. The USART uses two lines Tx and Rx, the data is transmitted through the Tx line and received through the Rx line. Let's see how to make ATmega32 communicate with a laptop.

ADXL345 Accelerometer using ATmega32

The ADXL345 is a tiny, low cost and ultra-low power 3-axis accelerometer which works on both SPI and TWI interfaces. It has use selectable sensitivity and give quite reliable readings considering its cost. The ADLX345 circuit in the IMU has TWI interface. I will be using ATmega32 in the following project clocked at 8MHz using the internal oscillator.
Here is the circuit diagram of how the ADXL345 accelerometer is connected, also you can see that the slave address is given as 0x53. The address can also be found out from the I2C scanner as shown here.
The ADX345 supports the standard (100 kHz) and the fast (400 kHz) data transfer modes. For more info see datasheet.

Tuesday, October 15, 2013

I2C Scanner

The fast and easy way to find out the i2c devices connected to arduino. It also helps to find out whether the wiring is correct or not, usually people tend to interchange the SCL and SDA wire and waste a lot of time.