CDN加速镜像 | 设为首页 | 加入收藏夹
当前位置: 首页 资源下载 源码下载 嵌入式/单片机编程 微处理器(ARM/PowerPC等)

文件名称: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
(系统自动生成,下载前可以参看下载内容)

下载文件列表

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

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 搜珍网是交换下载平台,只提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。更多...
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或换浏览器;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*快速评论: 推荐 一般 有密码 和说明不符 不是源码或资料 文件不全 不能解压 纯粹是垃圾
*内  容:
*验 证 码:
搜珍网 www.dssz.com