Shop OBEX P1 Docs P2 Docs Learn Events
SX port will not flip flop in run mode but will in walk mode — Parallax Forums

SX port will not flip flop in run mode but will in walk mode

Randy HarrisRandy Harris Posts: 11
edited 2005-10-14 13:32 in General Discussion
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

  • pjvpjv Posts: 1,903
    edited 2005-10-13 01:44
    Hi Randy;

    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 HarrisRandy Harris Posts: 11
    edited 2005-10-13 03:08
    I don't think that adding nops will help since I have several other steps plus a several 5 microsecond delay loops(80) before the next transition. But there may be something to your idea ofcapacitance. Is there any way to remove it?
    Randy
  • pjvpjv Posts: 1,903
    edited 2005-10-13 04:18
    Hi Randy;

    It's difficult to help when you keep us guessing.

    Peter (pjv)
  • Randy HarrisRandy Harris Posts: 11
    edited 2005-10-13 12:50
    I am sorry about being vague.· I have more than one bit that is being turned on and off.· The one· I described is probably the slowest one of the group.· Like I said it is strange.· I am trying to do synchronious inputs 60 times per second.· The signal that will not work in the "run" mode with a wire attached to it is the attention signal which goes low to get the attention of the device.·

    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.
  • BeanBean Posts: 8,129
    edited 2005-10-13 13:03
    Randy,
    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."
    ·
  • pjvpjv Posts: 1,903
    edited 2005-10-13 13:57
    Bean;

    That suggestion seems to be falling on deaf ears..... I guess he really does not want any help.

    Cheers,

    Peter (pjv)
    ·
  • Randy HarrisRandy Harris Posts: 11
    edited 2005-10-13 20:04
    Enclosed is an edited version of the program that will not work as I want it to work. I have uploaded the file Poll.src.
    Randy
  • James NewtonJames Newton Posts: 329
    edited 2005-10-14 00:33
    Read - Modify - Write

    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!



  • pjvpjv Posts: 1,903
    edited 2005-10-14 03:38
    Randy;

    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)
  • Randy HarrisRandy Harris Posts: 11
    edited 2005-10-14 13:32
    THANKS! THANKS! jumpin.gif

    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
Sign In or Register to comment.