Shop OBEX P1 Docs P2 Docs Learn Events
A Newbie that needs help - Please! (Concerning SXSim port problems - possible — Parallax Forums

A Newbie that needs help - Please! (Concerning SXSim port problems - possible

Bill FrankeBill Franke Posts: 20
edited 2006-03-15 16:46 in General Discussion
I posted this earlier, but didn't get any response. Thought I would try again.

Hi, I'm a newbie to Parallax and have been doing a crash course on the SX52. I downloaded Guenther Daubach's latest SXSim but that did not seem to help my problem. I'm not sure if it is a bug in the sim, or my programming. I tend to think the latter.

Anyway, the problem I'm having is this: When I load port re with my final value, I then change the port direction back to input, but on the sim, re value doesn't change. It remembers the last value it had as an output. I would think that after SXSim sees the Data Direction Register turn to input, that it would immediately check the I/O panel values for that port and plug them into that port's register. Instead, what I am finding, is that port re has the output value still in it. I don't know though, if this is a bug in SXSim or the way I'm doing things. Has anyone else seen this problem?

Here is the code I have.

Start
mov w,#$1F
mov m,w
mov !re,#%00000000 ; Set port D to output direction so I can directly store in the register
mov re,#%10101010

mov !re,#%11111111 ; Set port D back to input direction

Main
jmp Main ; In SXSim, at this point, re will still have %10101010 even though the I/O panel has all %00000000

Thanks for any help.

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-15 16:43
    The RE register will contain %10101010 until you clear it; the outputs show %00000000 because you have set the port to all inputs, effectively disconnecting the output register from the I/O pins.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-15 16:46
    This thread seems to be a duplicate (please don't do that....) so I am locking it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.