文件名称:I2C
-
所属分类:
- 标签属性:
- 上传时间:2013-08-02
-
文件大小:108.3kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
4. I2C程序设计与电路仿真
LPC2138微控制器具有标准的硬件I2C接口,可配置主机或从机,总线时钟频率可调整,可支持400KHZ总线频率。使用I2C总线时,要将P0.2、P0.3连接设置选择SCL、SDA,并且总线上要接两个上拉电阻,阻值1~5千欧。
定义器件的地址和LED输出端口,设置包括从机地址、子地址、数据缓冲区指针、操作数据个数、操作结束标志、子地址使能控制在内的变量。使用PINSEL0、PINSEL1寄存器设置I/O口工作模式,设置LED控制口为输出,其他I/O为输入。将I2C初始化,设置晶振频率,所有通道为IRQ中断,使能I2C中断,写入字节数据写入字节数据,等待周期结束。使用硬件I2C读取数据,在初始地址读出字节数据,若检验读出的数据不正确,读写E2PROM出错报警,闪烁LED报警。
-4. I2C program design and circuit simulation LPC2138 microcontroller with a standard hardware I2C interface, you can configure master or slave, the bus clock frequency is adjustable, can support 400KHZ bus frequency. Using the I2C bus, to P0.2, P0.3 connection settings Select SCL, SDA, and the bus to pick two pull-up resistor, the resistance of 1 to 5 kilohms. Define the address of the device and the LED output port settings include the slave address, subnet address, data buffer pointer, the number of operational data, the operation marks the end of the sub-address enable control, including variables. Use PINSEL0, PINSEL1 register set I/O port mode, set the LED control port as output, other I/O as an input. The I2C initialization, set the crystal frequency, all channels for the IRQ interrupt, I2C interrupt is enabled, the write byte data write byte data, waiting period ends. Using hardware I2C read the data byte read in the initial address data, if the test data read out is not correct
LPC2138微控制器具有标准的硬件I2C接口,可配置主机或从机,总线时钟频率可调整,可支持400KHZ总线频率。使用I2C总线时,要将P0.2、P0.3连接设置选择SCL、SDA,并且总线上要接两个上拉电阻,阻值1~5千欧。
定义器件的地址和LED输出端口,设置包括从机地址、子地址、数据缓冲区指针、操作数据个数、操作结束标志、子地址使能控制在内的变量。使用PINSEL0、PINSEL1寄存器设置I/O口工作模式,设置LED控制口为输出,其他I/O为输入。将I2C初始化,设置晶振频率,所有通道为IRQ中断,使能I2C中断,写入字节数据写入字节数据,等待周期结束。使用硬件I2C读取数据,在初始地址读出字节数据,若检验读出的数据不正确,读写E2PROM出错报警,闪烁LED报警。
-4. I2C program design and circuit simulation LPC2138 microcontroller with a standard hardware I2C interface, you can configure master or slave, the bus clock frequency is adjustable, can support 400KHZ bus frequency. Using the I2C bus, to P0.2, P0.3 connection settings Select SCL, SDA, and the bus to pick two pull-up resistor, the resistance of 1 to 5 kilohms. Define the address of the device and the LED output port settings include the slave address, subnet address, data buffer pointer, the number of operational data, the operation marks the end of the sub-address enable control, including variables. Use PINSEL0, PINSEL1 register set I/O port mode, set the LED control port as output, other I/O as an input. The I2C initialization, set the crystal frequency, all channels for the IRQ interrupt, I2C interrupt is enabled, the write byte data write byte data, waiting period ends. Using hardware I2C read the data byte read in the initial address data, if the test data read out is not correct
(系统自动生成,下载前可以参看下载内容)
下载文件列表
I2C/CONFIG.H
I2C/HEAP.S
I2C/I2C.axf
I2C/I2C.DSN
I2C/I2C.hex
I2C/I2C.htm
I2C/I2C.lnp
I2C/I2C.map
I2C/I2C.Opt
I2C/I2C.plg
I2C/I2C.PWI
I2C/I2C.sct
I2C/I2C.tra
I2C/I2C.Uv2
I2C/I2C_Opt.Bak
I2C/I2C_Target 1.dep
I2C/I2C_Uv2.Bak
I2C/IRQ.S
I2C/Last Loaded I2C.DBK
I2C/LPC2138.H
I2C/main.c
I2C/main.crf
I2C/main.d
I2C/main.o
I2C/STACK.S
I2C/Startup.lst
I2C/Startup.o
I2C/Startup.s
I2C/TARGET.C
I2C/TARGET.H
I2C
I2C/HEAP.S
I2C/I2C.axf
I2C/I2C.DSN
I2C/I2C.hex
I2C/I2C.htm
I2C/I2C.lnp
I2C/I2C.map
I2C/I2C.Opt
I2C/I2C.plg
I2C/I2C.PWI
I2C/I2C.sct
I2C/I2C.tra
I2C/I2C.Uv2
I2C/I2C_Opt.Bak
I2C/I2C_Target 1.dep
I2C/I2C_Uv2.Bak
I2C/IRQ.S
I2C/Last Loaded I2C.DBK
I2C/LPC2138.H
I2C/main.c
I2C/main.crf
I2C/main.d
I2C/main.o
I2C/STACK.S
I2C/Startup.lst
I2C/Startup.o
I2C/Startup.s
I2C/TARGET.C
I2C/TARGET.H
I2C
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.