Shop OBEX P1 Docs P2 Docs Learn Events
Delay, PIN Command, BaudRate Options & SX-Key Listing Feature Request — Parallax Forums

Delay, PIN Command, BaudRate Options & SX-Key Listing Feature Request

YendorYendor Posts: 288
edited 2006-09-27 18:42 in General Discussion
Hi,

I have a few questions I'm running into on my project.· I'm using SX/B v. 1.51.02

1.· DELAY command - After I program the SX using the SX/Key, I'm getting slightly more of a delay on the first DELAY statement than on the second.· After one loop occurs all is fine, and after a reset all is fine.· It's seems to be only after programming.· Here's a snippit of the code:

Main: 
for idx = 1 to 10 
SEROUT Out, Baud, Data 
PAUSE 500 
SEROUT Out, Baud, Data 
PAUSE 500 
next 
END
However, if I add another pause before the loop, it works fine after programming:
Main: 
PAUSE 500 
for idx = 1 to 10 
SEROUT Out, Baud, Data 
PAUSE 500 
SEROUT Out, Baud, Data 
PAUSE 500 
next 
END


The assembly output looks the same...

2.· Now it could be part of the problem, as above.· I'm using the new PIN declariation:
MyOut PIN RA.1 OUTPUT

However, doesn't this·declariation make it an output, or should I go ahead and still initilize the A pins, as in:
Start: 
TRIS_A = %11111111

Also, I was suprised that the following gives the same assembly code: EQU RA.1·
MyOut1 PIN RA.1 OUTPUT
MyOut2·VAR RA.1

Is this correct?
I am setting TRIS_A·in question·#1, above.· A funny thing happens though.· I get invalid data unless I set TRIS_A before adding the initial DELAY statement.· Without, it seems to work fine, as I'm not sure I have an initialization issue or not.
3.· What's the difference betwen·the T and the OT baud modes in the baud rate for SERIN/SEROUT?
I see in the help file, that T (True)·seems to be no-parity, 8-data bits, and 1-stop bit.··Would "T" also include a start bit too?·What does "Open" mean?· No stop bit?

4.· I like to copy from the listing page (ctrl+L) and put it into another text editor for comparison (UltraEdit).· Would it be possible within the SX-Key IDE in·the next release to:
  • Allow ctrl-c to work, once code is highlighted in the Listing·- it seems to only work when I do rightclick-copy.
  • Allow the screen to stay where it's positioned in the Listing, instead of jumping back to the top?
  • If you close the Listing window, only the listing window should close, not the whole SX-Key IDE which occurs now.
Many thanks!· I'm having a blast!
Rodney

Comments

  • BeanBean Posts: 8,129
    edited 2006-09-26 18:03
    Rodney,

    · 1) I suspect the clock from the SX-Key is not stable right away. As you say, it works fine after reset.

    · 2) "MyOut PIN RA.1 OUTPUT" will make RA.1 an output when the code starts. But "TRIS_A = %11111111" will make ALL pin on RA INPUTS not outputs.

    · 3) "OT" serial mode is "OPEN-TRUE" in this mode the serial pin is only driven LOW or is an INPUT. You need to put a pull-up resistor on the pin to make it work properly. This mode is meant to be used in a bus configuration where more than 2 devices are communicating on the same wire.

    Bean.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.


    Post Edited (Bean (Hitt Consulting)) : 9/27/2006 12:40:49 AM GMT
  • YendorYendor Posts: 288
    edited 2006-09-26 18:24
    Thanks once again Bean!

    On #2 again,
    D'oh!·I guess it should have been TRIS_A = %00000000 -·that explains the funnyness.

    So, the PIN command effectly sets as output, so nothing is needed to be initalized in a START, using SEROUT, correct?
    I'm trying to see what PIN does in assembly.· Is there code·placed else where in the compiled·listing when using PIN, because when looking at the listing of the following, it seems·to be the same:
    MyOut1 PIN RA.1 OUTPUT
    MyOut2·VAR RA.2
    compiles to:
    MyOut1 EQU RA.1
    MyOut2 EQU RA.2

    Again, please execuse the newbie questions, but really appreciate the help!

    Rodney
  • PJMontyPJMonty Posts: 983
    edited 2006-09-27 00:21
    Rodney,

    I'm not sure what is going on on your computer, but closing the listing window on mine computer simply closes the list window. The rest of the IDE stays open. How are you closing the list window?

    When you say the code in the list window "jumps back to the top," what are you doing that causes this?
      Thanks, PeterM
  • BeanBean Posts: 8,129
    edited 2006-09-27 00:41
    Rodney,
    The code to setup the pins is generated by the "PROGRAM" directive.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.
    ·
  • YendorYendor Posts: 288
    edited 2006-09-27 01:54
    Hi Peter,

    You're right, not sure what's going on with my head when it occurred.· Closing the list window seems works fine.· I could have swarn this happened to me.

    As far as jumping back to the top here's the exact procedure:
    1. Open List window
    2. Scroll·down to a snippit of code several pages down, say line 234, highlight, right click, copy
    3. Open a text editor (in my case UEdit32, but does it w/ Notepad, as well)
    4. Paste the code (ctrl-v)
    5. Then when I go back to the list window (e.g. click on the list window), it's back at line 1, where I would expect it to stay at line 234.

    I'm not sure if this is also an issue to other users, and maybe I'm just a little picky (or there's something else wrong with my head, or my eyes!), but with the font used within the IDE, I'm noticing that 0 (zero) and O (oh) are exactly the same!· Notice here that the O is a little fatter using the Forum font.· Of course this has been a tricky programming issue for generations!

    Just some thoughts, and I appreciate the response!

    Rodney
  • RonWRonW Posts: 39
    edited 2006-09-27 03:28
    Rodney,

    If you click over to any window other than the SX list or SX editor, and then back to either SX window, the list scrolls to the top. You're right - this can be annoying.

    I have also experienced the IDE closing when you close the list window. For me it only happened when both the editor window and the list window were maximized. But there must be something else that triggers this because I couldn't duplicate it tonight.

    Ron
  • PJMontyPJMonty Posts: 983
    edited 2006-09-27 06:09
    Rodney and Ron,

    On my machine, I can click back and forth to any app and the list window scroll position doesn't budge a bit. It doesn't matter if I select text, have the cursor in the list window, have text selected - the scroll position stays in place no matter how often I click to another app and then back.

    I run Win2K. What OS are you using?
      Thanks, PeterM
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-09-27 07:03
    PeterM,

    On my machine (winxp with sp2) the list view also scrolls back to top
    when changing to another app and back. Not when changing to sxkey IDE and back to
    list view.

    regards peter
  • RonWRonW Posts: 39
    edited 2006-09-27 13:27
    The list scolls to the top on my XP sp2 and also on my old Win98.

    Ron
  • YendorYendor Posts: 288
    edited 2006-09-27 18:42
    Guys, thanks for confirming that I'm not insane, or at least with the application!

    I'm running WinXP, SP2, as well, so Peter, thanks for looking into this. It seems to be something with XP.

    I guess I need tighter code for now! :O)

    Rodney
Sign In or Register to comment.