SX port will not flip flop in run mode but will in walk mode
Randy Harris
Posts: 11
I have a very peculiar problem. I am trying to get rc.3 bit to flip/flop. I have a wire from rc.3 to a breadboard. Attached to the same row is one wire that is attached to a parallax oscilloscope. A third wire is attached to a cable that goes to a connector. RC.3 flip flops when in the walk mode. It does not flip flop when in the run mode. However, if I remove the third wire the oscilloscope does show a flip flop. Whenever I reattach the wire it stops. The best I can tell, the wire does not have a stray voltage or ground associated with it. ANY IDEAS?
Comments
Here is a guess....
This holds true only if you are running the SX flip/flop code at high speed........ and that is that the extra capacitance added when the wire is plugged in, is large enough that the output of the previous state has not adequately settled by the time the next "read" phase of the 4 cycle I/O instruction comes around.
This bites all of us on occasion, especially if you are new at the game. Add one or more instructions (no-ops are fine) between successive port accesses so more settling time is provided. This solves the problem if it is caused as per my guess.
If that is not the case, you will need to post your code so we might have more insight as to what you are (or are NOT) doing.
Cheers,
Peter (pjv)
Randy
It's difficult to help when you keep us guessing.
Peter (pjv)
It must be some strange capacitance problem.· It will not come down from 5 volts to ground even when the device is not connected but the wire is still connected.· I can even remove all wires from the device except the attention wire and it still will not work.· As soon as I remove that one wire it will work.· I will try not using th prototyping board and see if that will work.
It will help us greatly if you post your code.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
Product web site: www.sxvm.com
Available now... SX-Video OSD module $59.95 www.sxvm.com
"Save your money. Pay with cash."
·
That suggestion seems to be falling on deaf ears..... I guess he really does not want any help.
Cheers,
Peter (pjv)
·
Randy
http://www.sxlist.com/techref/readmodwrite.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
---
James Newton, Host of SXList.com
james at sxlist,com 1-619-652-0593 fax:1-208-279-8767
SX FAQ / Code / Tutorials / Documentation:
http://www.sxlist.com Pick faster!
I had a quick look at the code, and nothing jumps out at me.
But in the deleted sections, are you certain that you don't have any consectutive port accesses? As James indicates, there is a READ-MODIFY-WRITE issue with the SXes at high speed.
The fact that it appears to work OK at slow speeds (single stepping) sure points to that issue.
Will it run with a slower resonator, or the internal RC oscillator?
I would have sworn it was a capacitance/consecutive access problem.
Can you please post the complete code, or is it secret? I will try to run it, add some small capacitance, and see what I get.
Cheers,
Peter (pjv)
Thanks to you all especially James and Peter.
I separated the setb and clrb from each other and it now works like I thought it should.
It is good to know how the microcode works sometimes.
Thanks again.
Randy