⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ce119_readme.txt

📁 本例程是描述了通过PIC33FXXX单片机的I2C接口实现对单片机外围EEPROM的访问
💻 TXT
字号:
                     Readme File for Code Example:
               CE119 - I2C Serial EEPROM Interface
               ---------------------------------------------------

This file contains the following sections:
1. Code Example Description
2. Folder Contents
3. Suggested Development Resources
4. Reconfiguring the project for a different dsPIC33F device
5. Revision History


1. Code Example Description:
----------------------------

In this code examples, 10bytes of data is written to I2C serial EEPROM and 
then read back using I2C peripheral. 

I2C EEPROM driver module takes two inputs viz., Command and Data Object
Driver supports two commands viz., Read and Write 

// EEPROM DRIVER Module
typedef struct { 
        unsigned int	cmd; 		// Command Input
	I2CEMEM_DATA	*oData;	       	// I2C Serial EEPROM Data Object
        void (*init)(void *);                   
        void (*tick)(void *); 
        }I2CEMEM_DRV; 

I2C Serial EEPROM data object contains EEPROM address location, data buffer, size
of the data buffer and chip select bits for device addressing
// Data Object
typedef struct { 
        unsigned int *buff;     	// Data Buffer 
        unsigned int n;        		// Size of the Data Buffer
        unsigned int addr;       	// EEPROM Address
        unsigned int csel;            	// Chip Select bits (A2,A1,A0 bits)
}I2CEMEM_DATA; 


* I2C Serial EEPROM read/write operation begins with transmitting control byte first. 
This control byte contains 8bits as shown below
 ------------------------------------
| 1 | 0 | 1 | 0 | A2 | A1 | A0 | R/W |
 ------------------------------------

1010 is the code used for I2C Serial EEPROM peripheral and A2,A1,A0 is used for chip select (csel).


* After the control byte, address of serial EEPROM is sent for read/write operation
Small memory I2C EEPROM will use 1byte address and large memory I2C EEPROM will need 2byte addressing. 
User must select either 1byte memory address or 2byte memory address using 
i2cEmem.h file. 

// EEPROM ADDRESS SIZE
#define ADDRWIDTH   TWO_BYTE    



2. Folder Contents:
-------------------
This folder contains the following sub-folders:
a. C:\Program Files\Microchip\MPLAB C30\support\gld
        This folder will have the device GLD file, it is used for building the project. 
	This file was provided with the MPLAB

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -