A Newbie that needs help - Please! (Concerning SXSim port problems - possible
Bill Franke
Posts: 20
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.
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 Williams
Applications Engineer, Parallax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax