This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to write a debug.ini to simulate 4*4 keypad conntected with P1??

i write a function ,but it not works at all..
how can i do?
signal void key_s1()
{ while((P4 &0x0f) != 0) { twatch(10); }

P4 &= 0x0f; twatch(200); P4 |= 0xf0;

while((P4 &0x0f) != 0) { twatch(10); }

P4 &= 0x0f; twatch(200); P4 |= 0xf0;

}

Parents
  • how can i do?
    tell us what you "know" and assume we know as well.
    What pins (names, not numbers) is the keypad connected to (columns/rows)?
    What derivative do you use?
    Have you any idea of debouncing?
    comment your scribbles (anything without comments is NOT 'code').
    what is 'signal', what is 'twatch'?

    I know you are asking how to simulate, but with the above, no amount of simulation is going to help you

    Erik

Reply
  • how can i do?
    tell us what you "know" and assume we know as well.
    What pins (names, not numbers) is the keypad connected to (columns/rows)?
    What derivative do you use?
    Have you any idea of debouncing?
    comment your scribbles (anything without comments is NOT 'code').
    what is 'signal', what is 'twatch'?

    I know you are asking how to simulate, but with the above, no amount of simulation is going to help you

    Erik

Children
  • thanks a lot!

    the example is 89c51 ,keyboard is the common 4*4 keyboard.like this:

    p1.0--|---|---|-----|-
    p1.1--|---|---|-----|-
    p1.2--|---|---|-----|-
    p1.3--|---|---|-----|-
    p1.4--|
    P1.5------|
    p1.6----------|
    p1.7----------------|

    i want to write a signal in debug.ini,like this

    i = 0;
    while(i++ < 1000)
    { P1 = 0x44 twatch(5); P1 = 0x44;
    }

    it can't works,Do you have any solution about it?

  • i want to write a signal in debug.ini,like this ... it can't works,Do you have any solution about it?

    nope, I would not even dream about using the simulator. I have one question: how would you 'simulate' switch bounce? how would you know if it was a) less or b) way more than your actual switches? one would lead to failure in the actual product, the other to a far too slow operation.

    all a simulator does is simulate, have you tried simulated sex, it is about as equivalent.

    Erik

  • Maybe he isn't interested in simulating the debounce logic, but want to be able to send commands to his application, and debug the application behaviour based on received keystrokes.

    It is possible to write a debugger script that uses a random time of bounces before settling.