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

Bug in simulation of virtual registors and their true port values

Hello!

Im using PK51 v9.05 for simulation poresess of external signal input.
Wrote script where time depended signal function change PORT3 pin state:

...
swatch (0.0250);
PORT3 ^= (1<<2);
swatch (0.0015);}
PORT3 |= (1<<2);
...

In analyzer window - I can see that correct signal, as PORT3 value,
but in program, when virtual PORT3, for ex. shows 0xFB value,
the real P3 always gives 0xFF .. Why, what did I wrong ?

PS: Strange, but some raroe time P3=PORT3 finally, not all time.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

PPS: Beside, I marked, when Logic Analyzer is active and collect plenty of trace data, pressing of "Reset CPU" button totally crash Keil (v4.22) IDE. Annoying bug really

Parents Reply Children
  • Since 8051 devices usually do not have a port direction register,
    Some do. See the Infineon XC800 family and I think there are others as well...

    there is NO "direction definition" in the classic '51 port
    I agree, not explicitely but a 0 in the SFR bit means an active low output which is a kind of direction.

    /Hans

  • kind of direction.
    if 'kind of' is your means of design I guess your code is kind of working.

    there, probably, is no '51 feature that has caused more confoosion than the exptression "port direction" since it is used by many - naah I will not use that word - to erroneously describe "output 1" as input which it can be, but not necessarily is. THERE IS NO DIRECTION IN A QUASI-BIDIRECTIONAL PORT

    Erik

  • Ok folks, am not a begginer and I good knowledge of architecture the c51/52.

    If support would be interesting I could send them demo project, that illustrate both of that bugs. But smth tells me, that they have been reported or just know about that problem.

    Regars.

  • Alex;
    Have you sent you code to Hans? Did you notice that Hans IS with Keil Support? You are lucky. Keil support does not often monitor this forum. It's primarily end users like your self that answers questions here.

    Bradford