obd2_prj

所属分类:压缩解压
开发工具:C/C++
文件大小:370KB
下载次数:27
上传日期:2012-04-14 21:47:52
上 传 者SOZooM
说明:  ECAN Module and source code obd.

文件列表:
obd2_prj (0, 2012-04-14)
obd2_prj\(ST).ST7,ST10,U435 CAN-do solutions for car multiplexing.pdf (150945, 2012-04-08)
obd2_prj\ECAN_src (0, 2012-04-14)
obd2_prj\ECAN_src\h (0, 2012-04-14)
obd2_prj\ECAN_src\h\i2cEmem.h (3561, 2007-09-12)
obd2_prj\ECAN_src\src (0, 2012-04-14)
obd2_prj\ECAN_src\src\i2cEmem.c (9108, 2008-02-08)
obd2_prj\ECAN_src\src\main.c (5499, 2008-02-08)
obd2_prj\ECAN_src\src\traps.c (5708, 2007-09-12)
obd2_prj\ECAN_src\test.mcp (1251, 2009-08-13)
obd2_prj\ECAN_src\test.mcw (38400, 2009-08-13)
obd2_prj\SAE J1699-1-2001.SAE J1850 verification test procedures.pdf (281071, 2012-04-08)

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 C30 toolsuite. b. C:\Program Files\Microchip\MPLAB C30\support\h This folder contains C header files useful in building this project. Device register and bit definitions are provided in the *.h file that follows the device name. These files were provided with the MPLAB C30 toolsuite. c. C:\Program Files\Microchip\MPLAB C30\lib This folder contains library archive files, which are a collection of precompiled object files. The file named "libpic30-coff.a" contains the C run-time start-up library. These file were provided with the MPLAB C30 toolsuite. d. hex This folder contains three file types - coff, hex and map. These are files generated by the MPLAB C30 toolsuite on build operation performed within MPLAB IDE. The *.map file contains details on memory allocation for various variables, constants and dsPIC instructions specified in the source and library code. The *.hex file contains a binary file that may be programmed into the dsPIC device. The *.coff file contains a binary file that is used by MPLAB IDE for simulation. e. h This folder contains include files for the code example. f. src This folder contains all the C and Assembler source files (*.c, *.s) used in demonstrating the described example. This folder also contains a sub-folder named "obj" that stores compiled object files generated when the project is built. 3. Suggested Development Resources: ----------------------------------- a. Explorer 16 Demo board with dsPIC33FJ256GP710 controller 4. Reconfiguring the project for a different dsPIC33F device: ------------------------------------------------------------- The Project/Workspace can be easily reconfigured for any dsPIC33F device. Please use the following general guidelines: a. Change device selection within MPLAB IDE to a dsPIC33F device of your choice by using the following menu option: MPLAB IDE>>Configure>>Select Device b. Provide the correct device linker script and header file for your device. Device linker scripts and header files are available in your MPLAB C30 installation folder under: Device Linker Script- YourDrive:>Program Files\Microchip\MPLAB C30\support\gld Device C Header file- YourDrive:>Program Files\Microchip\MPLAB C30\support\h Device ASM Include file- YourDrive:>Program Files\Microchip\MPLAB C30\support\inc c. Provide the appropriate path to your MPLAB C30 support file locations using the menu option: MPLAB IDE>>Project>>Build Options>>Project d. Chose the development board applicable to your device. Some options are provided below: e. Re-build the MPLAB project using the menu option: MPLAB IDE>>Project>>Build All f. Download the hex file into the device and run. 5. Revision History : --------------------- 07/09/2006 - Initial Release of the Code Example

近期下载者

相关文件


收藏者