STM32_I2_24C512

所属分类:单片机开发
开发工具:C/C++
文件大小:315KB
下载次数:123
上传日期:2010-09-30 09:13:42
上 传 者songchengqiao
说明:  STM32单片机操作AT24C512I2C存储器
(STM32 AT24C512 I2C)

文件列表:
I2_24C512\Debug\Exe\I2C_24C512.out (101288, 2010-09-21)
I2_24C512\Debug\Exe\I2C_24C512.sim (2951, 2010-09-21)
I2_24C512\Debug\Obj\core_cm3.o (19204, 2010-09-21)
I2_24C512\Debug\Obj\I2C_24C512.pbd (596, 2010-09-21)
I2_24C512\Debug\Obj\i2c_ee.o (21772, 2010-09-21)
I2_24C512\Debug\Obj\main.o (9380, 2010-09-21)
I2_24C512\Debug\Obj\startup_stm32f10x_hd.o (47016, 2010-09-21)
I2_24C512\Debug\Obj\stm32f10x_gpio.o (34308, 2010-09-21)
I2_24C512\Debug\Obj\stm32f10x_i2c.o (55400, 2010-09-21)
I2_24C512\Debug\Obj\stm32f10x_it.o (14584, 2010-09-21)
I2_24C512\Debug\Obj\stm32f10x_rcc.o (58756, 2010-09-21)
I2_24C512\Debug\Obj\system_stm32f10x.o (8876, 2010-09-21)
I2_24C512\I2C_24C512.dep (9158, 2010-09-21)
I2_24C512\I2C_24C512.ewd (37815, 2010-09-03)
I2_24C512\I2C_24C512.ewp (44095, 2010-09-03)
I2_24C512\I2C_24C512.eww (164, 2010-09-03)
I2_24C512\INC\i2c_ee.h (2292, 2010-09-03)
I2_24C512\INC\stm32f10x_conf.h (3213, 2009-04-06)
I2_24C512\INC\stm32f10x_it.h (1899, 2009-04-06)
I2_24C512\Libraries\CMSIS\Core\CM3\core_cm3.c (16249, 2009-04-06)
I2_24C512\Libraries\CMSIS\Core\CM3\core_cm3.h (42077, 2009-04-06)
I2_24C512\Libraries\CMSIS\Core\CM3\startup\arm\startup_stm32f10x_hd.s (15872, 2009-04-06)
I2_24C512\Libraries\CMSIS\Core\CM3\startup\arm\startup_stm32f10x_ld.s (12236, 2009-04-06)
I2_24C512\Libraries\CMSIS\Core\CM3\startup\arm\startup_stm32f10x_md.s (12564, 2009-04-06)
I2_24C512\Libraries\CMSIS\Core\CM3\startup\gcc\startup_stm32f10x_hd.c (16437, 2009-04-06)
I2_24C512\Libraries\CMSIS\Core\CM3\startup\gcc\startup_stm32f10x_ld.c (12790, 2009-04-06)
I2_24C512\Libraries\CMSIS\Core\CM3\startup\gcc\startup_stm32f10x_md.c (13104, 2009-04-06)
I2_24C512\Libraries\CMSIS\Core\CM3\startup\iar\startup_stm32f10x_hd.s (16573, 2009-04-06)
I2_24C512\Libraries\CMSIS\Core\CM3\startup\iar\startup_stm32f10x_ld.s (12001, 2009-04-06)
I2_24C512\Libraries\CMSIS\Core\CM3\startup\iar\startup_stm32f10x_md.s (12492, 2009-04-06)
I2_24C512\Libraries\CMSIS\Core\CM3\stm32f10x.h (530869, 2009-04-06)
I2_24C512\Libraries\CMSIS\Core\CM3\system_stm32f10x.c (24166, 2009-04-06)
I2_24C512\Libraries\CMSIS\Core\CM3\system_stm32f10x.h (2158, 2009-04-06)
I2_24C512\Libraries\CMSIS\Core\Documentation\CMSIS_Core.htm (50779, 2009-04-06)
I2_24C512\Libraries\STM32F10x_StdPeriph_Driver\inc\misc.h (4951, 2009-04-06)
I2_24C512\Libraries\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h (19558, 2009-04-06)
I2_24C512\Libraries\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h (7373, 2009-04-06)
I2_24C512\Libraries\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h (14289, 2009-04-06)
I2_24C512\Libraries\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h (1980, 2009-04-06)
I2_24C512\Libraries\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h (10271, 2009-04-06)
... ...

/** @page I2C_M24C08_EEPROM I2C_M24C08_EEPROM @verbatim ******************** (C) COPYRIGHT 2009 STMicroelectronics ******************* * @file I2C/M24C08_EEPROM/readme.txt * @author MCD Application Team * @version V3.0.0 * @date 04/06/2009 * @brief Description of the I2C and M24C08 EEPROM communication example. ****************************************************************************** * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. ****************************************************************************** @endverbatim @par Example Description This example provides a basic example of how to use the I2C software library and an associate I2C EEPROM driver to communicate with an M24C08 EEPROM. I2C1 is configured in Master transmitter during write operation and in Master receiver during read operation from I2C EEPROM. The speed is set to the maximum frequency of 400kHz. This value is defined in the I2c_ee.c file, which could be in the range of 0 to 400KHZ. One I2C EEPROM Block address where the program will write the buffer have to be selected from the four address available and defined in the I2c_ee.h file. The EEPROM address where the program start the write and the read operations is defined in the main.c file. First, the contents of Tx1_Buffer are written to the EEPROM_WriteAddress1 and the written data are read. The written and the read buffers data are then compared. Following the read operation, the program wait that the EEPROM reverts to its Standby state. A second write operation is, then, performed and this time, Tx2_Buffer is written to EEPROM_WriteAddress2, which represents the address just after the last written one in the first write. After completion of the second write operation, the written data are read. The contents of the written and the read buffers are compared. @par Directory contents - I2C/M24C08_EEPROM/stm32f10x_conf.h Library Configuration file - I2C/M24C08_EEPROM/stm32f10x_it.c Interrupt handlers - I2C/M24C08_EEPROM/stm32f10x_it.h Interrupt handlers header file - I2C/M24C08_EEPROM/main.c Main program - I2C/M24C08_EEPROM/i2c_ee.c I2C EEPROM driver - I2C/M24C08_EEPROM/i2c_ee.h Header for the i2c_ee.c file @par Hardware and Software environment - This example runs on STM32F10x High-Density, STM32F10x Medium-Density and STM32F10x Low-Density Devices. - This example has been tested with STMicroelectronics STM3210E-EVAL (STM32F10x High-Density) and STM3210B-EVAL (STM32F10x Medium-Density) evaluation boards with addition of the following hardware connection and can be easily tailored to any other supported device and development board. - STM3210E-EVAL Set-up - Connect I2C1 SCL pin (PB.06) to I2C EEPROM SCL (pin6) - Connect I2C1 SDA pin (PB.07) to I2C EEPROM SDA (pin5) - Check that a pull-up resistor (4.7K) is connected on one I2C SDA pin - Check that a pull-up resistor (4.7K) is connected on one I2C SCL pin - Connect I2C EEPROM Vcc (pin8) to Vdd - Connect I2C EEPROM Vss (pin4) to Vss - STM3210B-EVAL Set-up - Connect I2C1 SCL pin (PB.06) to I2C EEPROM SCL (pin6) - Connect I2C1 SDA pin (PB.07) to I2C EEPROM SDA (pin5) - Check that a pull-up resistor (4.7K) is connected on one I2C SDA pin - Check that a pull-up resistor (4.7K) is connected on one I2C SCL pin - Connect I2C EEPROM Vcc (pin8) to Vdd - Connect I2C EEPROM Vss (pin4) to Vss @note The pull-up resitors are already implemented on the STM3210B-EVAL and STM3210E-EVAL evaluation boards. @par How to use it ? In order to make the program work, you must do the following : - Create a project and setup all project configuration - Add the required Library files : - stm32f10x_i2c.c - stm32f10x_rcc.c - stm32f10x_gpio.c - system_stm32f10x.c - Edit stm32f10x.h file to select the device you are working on. @b Tip: You can tailor the provided project template to run this example, for more details please refer to "stm32f10x_stdperiph_lib_um.chm" user manual; select "Peripheral Examples" then follow the instructions provided in "How to proceed" section. - Link all compiled files and load your image into target memory - Run the example @note - Low-density devices are STM32F101xx and STM32F103xx microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. - Medium-density devices are STM32F101xx and STM32F103xx microcontrollers where the Flash memory density ranges between 32 and 128 Kbytes. - High-density devices are STM32F101xx and STM32F103xx microcontrollers where the Flash memory density ranges between 256 and 512 Kbytes. *

© COPYRIGHT 2009 STMicroelectronics

*/

近期下载者

相关文件


收藏者