2711 views|4 replies

18

Posts

0

Resources
The OP
 

iic communication, the host cannot receive relevant data [Copy link]

Problem description: During the master-slave communication process, the host cannot always receive the key value sent when the touch screen is pressed, but can receive the key value sent when it is lifted.

Is it because the interrupt signal time is too short? The IIC bus is busy? Or is it because of some other reason? Slave microcontroller PIC16F15375 Master STM32F4

Figure 1: iic program [attach]506847 [/attach] Figure 2: Touch screen data transmission process

Figure 3: Host serial port output phenomenon, failed 01 means no coordinate value is received when the key is pressed, 41 xx xx means the coordinate value is received when the key is lifted

屏幕截图(23).png (86.21 KB, downloads: 0)

屏幕截图(23).png
This post is from Microchip MCU

Latest reply

That means there is something wrong with the program structure. So go through the process carefully. The key is logical processing.   Details Published on 2020-10-23 16:06
 

1w

Posts

143

Resources
2
 

For program problems, the most intuitive way is to use a third-party monitor to look at the data on the bus. First rule out program problems on the sending end, and then you can be sure that the program problem is in the receiving part.

This post is from Microchip MCU
 
Personal signature上传了一些书籍资料,也许有你想要的:http://download.eeworld.com.cn/user/chunyang
 
 

1942

Posts

2

Resources
3
 

Do you mean that when the screen is pressed, the slave cannot receive the IIC data sent by the master? Most likely, the slave cannot trigger the IIC interrupt when the screen is pressed.

This post is from Microchip MCU
 
 
 

18

Posts

0

Resources
4
 
chunyang posted on 2020-10-21 16:40 For program problems, the most intuitive way is to use a third-party monitor to look at the data on the bus. First rule out the program problem on the sending end, then you can be sure that it is the receiving part...

The problem should be that if there is no while waiting for the key to be released, the host serial port will always print out data. But now after adding the key release program, the phenomenon of not receiving data will occur. The host returns that it has not received ACK, but it is strange that continuous and rapid clicks on the screen will receive data, but single clicks will not. But the iic sending part program has not found any problems... It is difficult to solve, please help!

This post is from Microchip MCU

Comments

That means there is something wrong with the program structure. So go through the process carefully. The key is logical processing.  Details Published on 2020-10-23 16:06
 
 
 

1w

Posts

143

Resources
5
 
Ke Xiaoxi posted on 2020-10-23 15:37 If there is a problem with the sending part, if there is no while waiting for the key to be lifted, the host serial port will always print out data. But now add the button...

That means there is something wrong with the program structure. So go through the process carefully. The key is logical processing.

This post is from Microchip MCU
 
Personal signature上传了一些书籍资料,也许有你想要的:http://download.eeworld.com.cn/user/chunyang
 
 

Guess Your Favourite
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