How to use the

I2C EEPROM & Bcd Plugins 


Index

Overview
The Project
Configuring the Plugin
I2C Log Files
Conclusion
        

 

Overview

External EEPROM memory is often a necessary addition to embedded projects, however, troubleshooting at the hardware level can be frustrating and time consuming.  The I2C plugin can remove the doubt about the software being at fault.  The ability to run the simulation and see at a glance the data being written to the external EEPROM Makes debugging communications much more straightforward.  The I2C EEPROM plugin can simulate a device up to 64k bytes covering a broad range of applications.  

When numerical data needs to be quickly read 7-segment and 12-segment are usually a good choice.   

This tutorial will show how to:

 

 

The Project

This part of the code in i2cmain.c contains the high level control:

.
.
.

for(num = 0;num < 255;num++)
{
/* Writes address number to the address Location */
ByteWrite( 0x50, 0, num, num+1 ); 

/* The following line used to display in BCD */ 
PORTB=char_to_bcd(RetrieveData( 0x50, 0, ( num - 1 ))); /* Reads back to port B in BCD*/
/* The following line used to display in hex */
/* PORTB=RetrieveData( 0x50, 0, ( num - 1 )); /* Reads back to port B in hexadecimal*/
}
.
.
.

The for loop controls the addresses written to and increments the values sent as data.  The first output line converts the output to BCD form so the data will display correctly in that format.  The second  output line does not convert the output  so the data will display correctly in hexadecimal.

Once the project has been built enter debug mode by clicking the bug  on the tool bar. 

 

Configuring the Plugin

Configure your plugins like this:

 

 

To change to hex output check the radio button.

 

 

I2C Log Files

The output from the I2C log popup can be saved to file 

 

A line by line explanation of the log listing above : 

Conclusion

The I2C EEPROM plugin offers a simple way to debug I2C communications software with out expensive hardware and hookup time.  This project has also shown the way the Bcd  plugin can be used to simplify the analysis of output data.

Return to Plugin Help

Legal Information

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

  THE AUTHOR RESERVES THE RIGHT TO REJECT ANY LICENSE (REGISTRATION) REQUEST WITHOUT EXPLAINING THE REASONS WHY SUCH REQUEST HAS BEEN REJECTED. IN CASE YOUR LICENSE (REGISTRATION) REQUEST GETS REJECTED YOU MUST STOP USING THE SourceBoost IDE, C2C-PLUS, C2C++, P2C-plus and BoostC COMPILERS AND REMOVE THE WHOLE SourceBoost IDE INSTALLATION FROM YOUR COMPUTER.


http://www.picant.com/c2c/c.html
Copyright © 2003-2006 Pavel Baranov
Copyright © 2003 Mark Duren