Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
RT-Thread一般讨论
关于i2c bit ops的疑问
发布于 2014-06-12 00:21:54 浏览:2030
订阅该版
平台:stm32f207 + AT24MAC402(eeprom) 碰到的问题: 1 设备地址问题,i2c的bit操作中,设备地址是不包括最低位的。也即是说如果高四位为1010,而A2 A1 A0 = 001,那么device id 为1010001 = 0x51; 2 采用aozima提供的测试例子(https://club.rt-thread.org/ask/question/3471.html)操作,能够读取数据,但是写不不了数据,写保护已经取消。打印信息如下:```i2c_test() i2c_test() msgs[0] W, addr=0x51, len=1犤 msgs[1] R, addr=0x51, len=2犤 send start condition wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high ACK wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high ACK write 1 byte wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high ACK wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high recieve bytes: 0xff, ACK wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high recieve bytes: 0xff, NACK read 2 bytes send stop condition read EEPROM at I2C address: 0x51 0x0000: FF FF 00 00 msgs[0] W, addr=0x51, len=1? msgs[1] W, addr=0x51, len=2? send start condition wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high ACK wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high ACK write 1 byte wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high ACK wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high ACK write 2 bytes send stop condition msgs[0] W, addr=0x51, len=1? msgs[1] R, addr=0x51, len=2? send start condition wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high ACK wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high ACK write 1 byte wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high ACK wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high recieve bytes: 0xff, ACK wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high wait 3 tick for SCL line to go high recieve bytes: 0xff, NACK read 2 bytes send stop condition re-read EEPROM at I2C address: 0x51 0x0000: FF FF ```
查看更多
2
个回答
默认排序
按发布时间排序
pangwei
2014-07-14
这家伙很懒,什么也没写!
1 开启代码优化会导致通信缓慢 2 写的问题排除了,跟硬件有关的问题
撰写答案
登录
注册新账号
关注者
0
被浏览
2k
关于作者
pangwei
这家伙很懒,什么也没写!
提问
7
回答
141
被采纳
1
关注TA
发私信
相关问题
1
有关动态模块加载的一篇论文
2
最近的调程序总结
3
晕掉了,这么久都不见layer2的踪影啊
4
继续K9ii的历程
5
[GUI相关] FreeType 2
6
[GUI相关]嵌入式系统中文输入法的设计
7
20081101 RT-Thread开发者聚会总结
8
嵌入式系统基础
9
linux2.4.19在at91rm9200 上的寄存器设置
10
[转]基于嵌入式Linux的通用触摸屏校准程序
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
【NXP-MCXA153】 定时器驱动移植
2
GD32F450 看门狗驱动适配
3
【NXP-MCXA153】看门狗驱动移植
4
RT-Thread Studio V2.2.9 Release Note
5
CherryUSB的bootuf2配置
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
I2C_IIC
UART
WIZnet_W5500
ota在线升级
PWM
freemodbus
flash
cubemx
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
编译报错
Debug
rt_mq_消息队列_msg_queue
SFUD
msh
keil_MDK
ulog
C++_cpp
MicroPython
本月问答贡献
踩姑娘的小蘑菇
7
个答案
2
次被采纳
a1012112796
16
个答案
1
次被采纳
Ryan_CW
5
个答案
1
次被采纳
红枫
4
个答案
1
次被采纳
张世争
4
个答案
1
次被采纳
本月文章贡献
YZRD
3
篇文章
6
次点赞
catcatbing
3
篇文章
6
次点赞
lizimu
2
篇文章
9
次点赞
qq1078249029
2
篇文章
2
次点赞
xnosky
2
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部