3062 views|1 replies

1

Posts

0

Resources
The OP
 

I2C communication problem with tm4c123gh6pm [Copy link]

I recently worked on a small project that required the use of the GY30 light intensity sensor, which I guess many people have used before, and uses I2C communication. I don't want to use the GPIO simulation method provided by the store's routines, so I want to try hardware I2C. According to the requirements of the GY30 data sheet, the first step is to send the slave address and instruction 0x01 to power on the sensor. Here, after I set the I2CMasterSlaveAddrSet function and confirmed that it is correct, I set the I2CMasterControl function in a continuous sending manner. Since two bytes are sent, the first one uses I2C_MASTER_CMD_BURST_SEND_START, and the second one uses I2C1_BASE, I2C_MASTER_CMD_BURST_SEND_FINISH; after each byte is sent, I2CMasterBusy is used to detect whether the transmission is completed, and then the I2CMasterErr function is used to detect whether the transmission is successful; The result is: there is no problem when sending the address byte, but once the instruction 0X01 is sent, I2CMasterErr will report an error. According to the error type fed back, it is a data response error, that is, no ACK bit is generated. Has anyone encountered this problem? How to solve it? Also, I would like to ask, does the setting of the I2CMasterSlaveAddrSet function already include operations such as "passing the corresponding address and read/write direction to the slave"?
This post is from Microcontroller MCU

Latest reply

The GPIO simulation method is simulated, and you can write and send it yourself. The timing is not too complicated. A frame of data should not be very long. Once a frame is done, you can perform the logical operation process according to the instructions in the sensor manual.  Details Published on 2018-7-25 13:21
 

3471

Posts

11

Resources
2
 
The GPIO simulation method is simulated, and you can write and send it yourself. The timing is not too complicated. A frame of data should not be very long. Once a frame is done, you can perform the logical operation process according to the instructions in the sensor manual.
This post is from Microcontroller MCU
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list