Quantcast
Channel: EngineersGarage - eeprom
Viewing all articles
Browse latest Browse all 20

How To Connect The EEPROM of The Arduino To The Serial Port of a PC

$
0
0

This Code is only visible to Registered users. Please Login/Register

 

How To Connect The EEPROM of The Arduino To The Serial Port of a PC

Developed By: 

Ajish Alfred

A kind of Read Only Memory (ROM), which can be written and erased by means of electrically programming the data, is called Electrically Erasable Programmable Read Only Memory (EEPROM). Once programmed the data it will remain in the memory for a very long time even if there is no power available. The EEPROM comes in small sized chips which can be interfaced with microcontrollers in a system. Most of the microcontrollers have built-in EEPROM with reasonable memory size so that for small kind of applications an extra memory chip can be avoided.

A microcontroller uses the EEPROM memory to store its data like sensor value, or a particular count or image data for a long period of time uses the EEPROM memory. The EEPROM memory is also used to save the data before the system switches itself off so that the same data can be retained next time when the system is turned on.The Arduino board has an AVR microcontroller in it which also has a built-in EEPROM memory. The memory size varies with the Arduino boards and the microcontroller used in them. The Arduino can be interfaced with the other devices with the help of its digital pins, analog pins and with the help of serial communication protocol.

The serial port of the microcontroller provides the easiest way by which the user and the microcontroller can write their data in the same medium and both can read each other’s data. When the serial port of the microcontroller is connected to the PC and the incoming and outgoing data is monitored using software and displayed in a window, it forms the simplest text user interface (TUI) setup for the microcontroller.This particular project demonstrates how to write some text starting from a particular memory location of the internal EEPROM of the Arduino and later read the entire EEPROM memory and display it on any serial monitoring software or using the Arduino’s serial monitor itself to find the same data once written.

How To Connect The EEPROM of The Arduino To The Serial Port of a PC

 

The Arduino is an easy prototyping platform in which the hardware is very simple to use and to be connected with any other system. The programing environment is also very easy to start with and has lot of built-in functions for every simple and complex task. The AVR microcontroller boards which are provided with all the basic circuitry for the operation of the microcontroller which has been flashed with the arduino boot-loader are called arduino boards. The arduino can communicate with the other devices using its digital I/O, serial port, I2C port, SPI port etc. In this particular project the Arduino pro-mini board is used which is then programmed with the help of Arduino IDE version 1.0.3 on windows operating system. The Arduino pro-mini board has ATMEGA328 microcontroller inside it which has a 1Kb of internal EEPROM memory. The internal EEPROM memory can be easily accessed using the built-in functions provided by the Arduino IDE. The board has also one set of Tx and Rx pins with the help of which the board can be interfaced with the serial port. The image of the Arduino pro-mini board and the Arduino IDE is shown in the following;

Arduino

 

Arduino

Since the arduino pro-mini board has no circuitary for interfacing it with the serial port or the USB port of the PC, an external USB to TTL converter board is required to connect it with the PC. This hardware helps in programming the arduino board and also helps in the serial communication with the PC through the USB port of the PC.

Arduino

It is assumed that the reader has gone through the project how to get started with the arduino and done all the things discussed in it. There are some built-in functions in the arduino IDE which helps in the serial communication process.There is a function which helps to initialize the serial communication port with a particular baud rate and there are functions to send data to the serial port. The functions used in this projects are namely Serial.begin(), Serial.print() and Serial.write(). The details of these functions and similar functions for the serial communication are already discussed in previous projects on how to do serial communication with the Arduino, how to send and receive serial data using arduino, how to do serial debugging with the Arduino. 

The Arduino IDE provides a library called <EEPROM.h> which provides functions to access the built-in EEPROM of the Arduino board’s microcontroller. The code written for this project also makes use of few functions from the <EEPROM.h> to read and write the built-in EEPROM. The functions are namely EEPROM.write() and EEPROM.read() and the details of those functions are already discussed in previous projects on how to read and write the EEPROM of the Arduino, how to test the EEPROM of the Arduino  and how to save a sensor value in the EEPROM of the Arduino.
THE CODE
The code written for this project first enables the serial port with the help of the function Serial.begin(). It then writes the entire EEPROM with white spaces with the help of the function EEPROM.write(). Then a predefined text is written to the EEPROM starting from a particular memory location using the same function EEPROM.write(). The code then reads entire EEPROM starting from the 0th location to the 1023th location using the function EEPROM.read(). Each data byte read is also printed on the serial port using the function Serial.write(). When the coding is finished one can verify and upload the code to the Arduino board as explained in the project how to get started with the Arduino. The Arduino board can then be connected to the PC using USB to TTL converter board and the data can be viewed on any serial monitoring software or using the Arduino IDE’s serial monitoring software as explained in the project how to do serial debugging with the Arduino.
Arduino
16 x 2 LCD | 16x2 Character LCD Module
LCD

 

LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very commonly used in various devices and circuits. These modules are...

Arduino Pro Mini
Arduino Pro Mini

The Arduino Pro Mini is an ATmega168 based microcontroller board. The board comes with built-in arduino bootloader. It has 14 digital input/output pins (of which 6 can be used as PWM...

LEDs | Light Emitting Diode
LED
 
Light emitting diodes...
Resistor Image
Resistor

Resistor is a passive component used to control current in a circuit. Its resistance is given by the ratio of voltage applied across its terminals to the current passing through it. Thus a particular value of resistor, for fixed voltage, limits the current through it. They are omnipresent in...

texas instrumentsTI launchpad
Banner_TI

Everything you need to get started

Start with a LaunchPad™ development kit

Start with a LaunchPad™ development kit

Know More >>

Stack on BoosterPack™ plug-in modules

Stack on BoosterPack™ plug-in modules

Know More >>

Scalable software tools for all experience levels

Scalable software tools for all experience levels

Know More >>

GET INSPIRED

Featured projects using TI LaunchPad kit

Control a CC3200 LaunchPad with your phone using Blynk

Control a CC3200 LaunchPad with your phone using Blynk

Know More >>

IoT real-time dashboard with PubNub & TI LaunchPad

IoT real-time dashboard with PubNub & TI LaunchPad

Know More >>

Multi-Touch with CapTIvate

Multi-Touch with CapTIvate

Know More >>

GET STARTED

TI LaunchPad™ development kits

Connected MCU

Connected MCU 

Know More >>

MSP430™ low power MCU

MSP430™ low power MCU

Know More >>

C2000™ performance  MCU

C2000™ performance MCU

Know More >>

Hercules™ safety MCU

Hercules™ safety MCU 

Know More >>


Viewing all articles
Browse latest Browse all 20

Trending Articles