The EEPROM (ELECTRICALLY ERASABLE PROGRAMMABLE READ ONLY MEMORY) is a very useful memory which can be used for storing data. The data storing and retrieving from any EEPROM memory is very simple compared to other kind of memories. As the name suggest the memory is electrically programmable and hence the data will be sustained in the memory until it is electrically erased or reprogrammed.
There are lots of EEPROM chips available most of them are easy to interface with a microcontroller. It would be even better if the microcontroller itself has a built-in EEPROM. The microcontroller used in this project is PIC18F4550 and it also has an inbuilt EEPROM memory other than the flash memory. The data can be easily stored into or retrieve using simple codes.
The project mainly has two parts, a serial communication part and EEPROM accessing part. The data which should be written into the EEPROM is received from the serial port. The internal hardware module USART is used for this purpose. The data which is read from the EEPROM is also send back to the serial port using the same hardware module.
Hence two internal modules of the PIC18F4550 are used in this project namely EEPROM and USART. These hardware modules can be accessed and controller by simply writing into or reading from their corresponding registers.
The important control registers associated with the USART and their details are given below:
TXSTA: TRANSMIT STATUS AND CONTROL REGISTER
This register has the bits which controls the serial transmission features like enable or disable the transmission, whether it should be synchronous asynchronous etc.
For a simple asynchronous serial transmission only two bits are significant, which areΒ TXENΒ andΒ SYNC
TXEN is the transmission enable/disable bit and SYNC sets the synchronous/asynchronous mode.
TXEN: Transmit Enable
1 = Transmit enabled
0 = Transmit disabled
SYNC: EUSART Mode Select bit
1 = Synchronous mode
0 = Asynchronous mode
RCSTA: RECEIVE STATUS AND CONTROL REGISTER
This register has the bits which controls the serial reception features like enable/disable the serial port, reception should be 8 bit or 9 bit, whether it should be synchronous asynchronous, enable/disable continuous reception etc.
For a simple asynchronous serial reception the significant bits areΒ SPEN, RX9Β andΒ CREN.
SPEN: Serial Port Enable bit
1 = Serial port enabled
0 = Serial port disabled
RX9: 9-Bit Receive Enable bit
1 = Selects 9-bit reception
0 = Selects 8-bit reception
CREN: Continuous Receive Enable bit
1 = Enables receiver
0 = Disables receiver
SPBRG: EUSART BAUD RATE GENERATOR REGISTER
This is a 16 bit register into which the value corresponding to the required baud-rate can be written into. The value according to a particular baud-rate can be calculated from the CPU clock frequency according to the following equation;
I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. ACCEPTCheck Privacy Policy
Manage consent
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.