5400 views|6 replies

5

Posts

0

Resources
The OP

zlg7290 ask for help [Copy link]

It can be displayed and interrupted, but the key value cannot be read! What is the reason? It was normal before and the program has not been changed. if(!key_INT) { key=ZLG7290_GetKey(); //The value read is always 0x00;
This post is from MCU

Latest reply

After eliminating the hardware cause, check whether there is a timing mismatch.  Details Published on 2008-5-8 14:16

102

Posts

0

Resources
2
Is if(!key_INT) checking the interrupt flag? Put key=ZLG7290_GetKey(); in the interrupt service and try it.
This post is from MCU

5

Posts

0

Resources
3
Single-step debugging found that when reading the key value in register 01 of 7290, the IRcvStr(zlg7290,1,&rece,1); function was called, but there was no response when SendByte(suba);, so the key value could not be obtained.
This post is from MCU

102

Posts

0

Resources
4
The problem description is not clear enough. Where is if(!key_INT) { key=ZLG7290_GetKey();? How did you debug? If you set a breakpoint after key=ZLG7290_GetKey();, can the program be executed to the breakpoint?
This post is from MCU

5

Posts

0

Resources
5
Keep querying KEY_INT in the main function loop. If there is an interrupt, call key=ZLG7290_GetKey(); It can run to the breakpoint, but the key value cannot be obtained. The problem lies in calling IRcvStr(zlg7290,1,&rece,1); **********************************************************************/ bit IRcvStr(uchar sla,uchar suba,uchar *s,uchar no) { uchar i; Start_I2c(); /*Start bus*/ SendByte(sla); /*Send device address*/ if(ack==0)return(0); SendByte(suba); /*Send device subaddress*/ if(ack==0)return(0); When sending the device subaddress, ack=0; there is no response, so it returns directly and the key value cannot be obtained. What is the reason? ? [This post was last edited by 16002613 on 2008-5-8 12:17]
This post is from MCU

102

Posts

0

Resources
6
After eliminating the hardware cause, check whether there is a timing mismatch.
This post is from MCU

5

Posts

0

Resources
7
Thank you, the software is fine. I just checked and found that it is a hardware problem. The crystal on the new system board is 12.000MHz. The previous one was 11.0592. The problem may be here. I will change the crystal later.
This post is from MCU

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>

    EEWorld
    subscription
    account

    EEWorld
    service
    account

    Automotive
    development
    circle

    Robot
    development
    community

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