PK2 UART tool


Closed Thread
Results 1 to 14 of 14

Thread: PK2 UART tool

  1. #1
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869

    Default PK2 UART tool

    I am not sure this is really a serial issue, but what the heck here goes.

    Is there a way to not have data scroll when using the UART tool? I realize sending the CR causes a line return, this is needed to not just overwrite the same line. What I want is to be able to do something like a home command, then re-write the screen with new values. Does this make sense?

    I guess I want a formated screen. I know I can't have this with the UART tool, but it seems like if I can start a new "block" of data at the top left, I will get close.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default Re: PK2 UART tool

    Maybe I am not following what you want, but I think the solution is in the PC side. You need a program that will only display the current/last line of data?
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869

    Default Re: PK2 UART tool

    Let me see if I can do better here. I have 18 words of data. I want to display the first word on the top line in the window, second value on the second line, so forth and so on down to the 18th value on the 18th line.

    Then I want to start back at the top when the new data set is transmitted. So first value on the first line, second on the second line, down to the bottom.

    The way it works for me now, is once the screen fills, it just scrolls, so I am just seeing data roll on by. I can stop(disconnect) then look back but of course the data has less value to me then.

    I looked through an ASCII chart, I don't think there is a control character for "home" or "clearscreen". After all how would that have been used back in the teletype days?
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  4. #4
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530

    Default Re: PK2 UART tool

    I have not tried it, but you might try chr$(26)

    CHR$(4)DOS command escape prefix
    CHR$(7)Make a "beep" (if your browser supports it)
    CHR$(8)Backspace (move cursor left, wrap up)
    CHR$(10)Line feed (move cursor down)
    CHR$(13)Carriage return (move cursor down and to left edge)
    CHR$(127)Displays a cursor glyph
    CHR$(11)Clears from the cursor position to the end of the window
    CHR$(12)Move cursor to upper left and clear window
    CHR$(14)Set normal text output
    CHR$(15)Set inverse text output
    CHR$(17)Set display to 40 columns
    CHR$(18)Set display to 80 columns
    CHR$(21)Deactivate the 80-column firmware
    CHR$(22)Scroll display down, preserving cursor position
    CHR$(23)Scroll display up, preserving cursor position
    CHR$(24)Disable mousetext
    CHR$(25)Move cursor to upper left (but don't clear window)
    CHR$(26)Clear the current line
    CHR$(27)Enable mousetext
    CHR$(28)Forward space (move cursor right, wrap down)
    CHR$(29)Clear from cursor position to end of line

  5. #5
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869

    Default Re: PK2 UART tool

    WALTER!!!! Where did this chart come from? Should I have read something related to PK2? (sarcasim aimed at myself)

    Looks like I need CHR$(12) or (25)

    Time to get ready for work now, but this is first on my fun list for tonight
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  6. #6
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530

    Default Re: PK2 UART tool

    Scratch that. That's applesoft, I see it varies greatly from the official ascii control character reference. Don't think that will work. But here's my reference: http://www.calormen.com/applesoft/reference.htm

    Yeah, maybe you could do something with form feed chr$(12)...

    Here's a list that is more complete than the manual, but alas, I do not see a clear.

    Ascii control codes (control characters, C0 controls)

    The following document lists the control codes (control characters) in Ascii and in newer character code standards like Unicode, which generally try to be compatible with Ascii in the Ascii code range (positions 0 through 127).

    code pos. UnicodeDescription in C0 of ISO 646

    dec. hex. abbr. name

    00NULNULL A control character used to accomplish media-fill or time-fill. Null characters may be inserted into or removed from a stream of data without affecting the information content of that stream. But then the addition or removal of these characters may affect the information layout and/or the control of equipment.
    ctl-A11SOHSTART OF HEADING A transmission control character used as the first character of a heading of an information message.
    ctl-B22STXSTART OF TEXT A transmission control character which precedes a text and which is used to terminate a heading.
    ctl-C33ETXEND OF TEXT A transmission control character which terminates a text.
    ctl-D44EOTEND OF TRANSMISSION A transmission control character used to indicate the conclusion of the transmission of one or more texts..
    ctl-E55ENQENQUIRY A transmission control character used as a request for a response from a remote station; the response may include station identification and/or station status. When a "Who are you" function is required on the general switched transmission network, the first use of ENQ after the connection is established shall have the meaning "Who are you" (station identification). Subsequent use of ENQ may, or may not, include the function "Who are you", as determined by agreement.
    ctl-F66ACKACKNOWLEDGE A transmission control character transmitted by a receiver as an affirmative response to the sender.
    ctl-G77BELBELL A control character that is used when there is a need to call for attention; it may control alarm or attention devices.
    ctl-H88BSBACKSPACE A format effector which moves the active position one character position backwards on the same line.
    ctl-I99HTHORIZONTAL TABULATION A format effector which advances the active position to the next pre-determined character position on the same line.
    ctl-J10ALFLINE FEED A format effector which advances the active position to the same character position of the next line.
    ctl-K11BVTVERTICAL TABULATION A format effector which advances the active position to the same character position on the next pre-determined line.
    ctl-L12CFFFORM FEED A format effector which advances the active position to the same character position on a pre-determined line of the next form or page.
    ctl-M13DCRCARRIAGE RETURN A format effector which moves the active position to the first character position on the same line.
    ctl-N14ESOSHIFT OUT A control character which is used in conjunction with SHIFT IN and ESCAPE to extend the graphic character set of the code. It may alter the meaning of octets 33 - 126 (dec.). The effect of this character when using code extension techniques is described in International Standard ISO 2022.
    ctl-O15FSISHIFT IN A control character which is used in conjunction with SHIFT OUT and ESCAPE to extend the graphic character set of the code. It may reinstate the standard meanings of the octets which follow it. The effect of this character when using code extension techniques is described in International Standard ISO 2022.
    ctl-P1610DLEDATA LINK ESCAPE A transmission control character which will change the meaning of a limited number of contiguously following characters. Its is used exclusively to provide supplementary data transmission control functions. Only graphic characters and transmission control characters can be used in DLE sequences.
    ctl-Q1711DC1DEVICE CONTROL ONE A device control character which is primarily intended for turning on or starting an ancillary device. If it is not required for this purpose, it may be used to restore a device to the basic mode of operation (see also DC2 and DC3), or for any other device control function not provided by other DCs.
    ctl-R1812DC2DEVICE CONTROL TWO A device control character which is primarily intended for turning on or starting an ancillary device. If it is not required for this purpose, it may be used to set a device to a special mode of operation (in which case DC1 is used to restore normal operation), or for any other device control function not provided by other DCs.
    ctl-S1913DC3DEVICE CONTROL THREE A device control character which is primarily intended for turning off or stopping an ancillary device. This function may be a secondary level stop, for example, wait, pause, stand-by or halt (in which case DC1 is used to restore normal operation). If it is not required for this purpose, it may be used for any other device control function not provided by other DCs.
    ctl-T2014DC4DEVICE CONTROL FOUR A device control character which is primarily intended for turning off, stopping or interrupting an ancillary device. If it is not required for this purpose, it may be used for any other device control function not provided by other DCs.
    ctl-U2115NAKNEGATIVE ACKNOWLEDGE A transmission control character transmitted by a receiver as a negative response to the sender.
    ctl-V2216SYNSYNCHRONOUS IDLE A transmission control character used by a synchronous transmission system in the absence of any other character (idle condition) to provide a signal from which synchronism may be achieved or retained between data terminal equipment.
    ctl-W2317ETBEND OF TRANSMISSION BLOCK A transmission control character used to indicate the end of a transmission block of data where data is divided into such blocks for transmission purposes.
    ctl-X2418CANCANCEL A character, or the first character of a sequence, indicating that the data preceding it is in error. As a result, this data is to be ignored. The specific meaning of this character must be defined for each application and/or between sender and recipient.
    ctl-Y2519EMEND OF MEDIUM A control character that may be used to identify the physical end of a medium, or the end of the used portion of a medium, or the end of the wanted portion of data recorded on a medium. The position of this character does not necessarily correspond to the physical end of the medium.
    ctl-Z261ASUBSUBSTITUTE A control character used in the place of a character that has been found to be invalid or in error. SUB is intended to be introduced by automatic means.
    ctl-[271BESCESCAPE A control character which is used to provide additional control functions. It alters the meaning of a limited number of contiguously following bit combinations. The use of this character is specified in International Standard ISO 2022.
    ctl-\281CFSFILE SEPARATOR A control character used to separate and qualify data logically; its specific meaning has to be specified for each application. If this character is used in hierarchical order, it delimits a data item called a file.
    ctl-]291DGSGROUP SEPARATOR A control character used to separate and qualify data logically; its specific meaning has to be specified for each application. If this character is used in hierarchical order, it delimits a data item called a group.
    ctl-^301ERSRECORD SEPARATOR A control character used to separate and qualify data logically; its specific meaning has to be specified for each application. If this character is used in hierarchical order, it delimits a data item called a record.
    ctl-_311FUSUNIT SEPARATOR A control character used to separate and qualify data logically; its specific meaning has to be specified for each application. If this character is used in hierarchical order, it delimits a data item called a unit.

    1277FDELDELETE(not defined)
    Last edited by ScaleRobotics; - 17th May 2011 at 10:46.

  7. #7
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869

    Default Re: PK2 UART tool

    Follow up, after googling for a while, I ended up back on PBP forum reading a thread started by Hank. The gist concerning this thread is UART tool won't do what I want. I need to use a real terminal or custom GUI. Well I don't plan that level of effort for the testing I am doing, So tonight I will try 1 last thing.

    If I can fit the data on 1 line, maybe I can send a "header" so to speak as the first line, then the data all out on the next line. When I send new data, I will send the code for backspace to see if I can get to the beginning of the data line and send the new data.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  8. #8
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818

    Default Re: PK2 UART tool

    Hi Bert,
    It sounds like you want to receive data and display it line over line in a "console" or dos type environment so it displays as :
    DATA WORD 1
    DATA WORD 2
    DATA WORD 3
    DATA WORD 4

    . . . is this correct ? Assuming it is then given a typical DOS " MODE" you could see
    80 x 40 characters.On screen.
    You would likely have to write this program for the PC probably in " C ". Or using VB in a GUI environment. Another option is to write your USART to output HTML and view in a browser . . . HTML could format text to display that way, I THINK.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  9. #9
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869

    Default Re: PK2 UART tool

    Hi Joe, that is mostly correct about how I want to display the data. But I want to overwrite the values with new values, not scroll them as the uart tool does now.

    I have no idea how or where to start to get data from a com port to a browser window. Next issue I have no idea how to get data from pk2 to an application. But I have spent time trying to learn both python and liberty basic, so maybe I should try and make an app for displaying the data. Dave (makracket) has an example of python serial on his website. So maybe I could head down that path.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  10. #10
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default Re: PK2 UART tool

    What you want to do, most, see all, ANSI terminal would do it. Hyperterminal, TeraTerm and so on.

    Check this link on Darrel's Website
    http://www.pbpgroup.com/modules/wfse...hp?articleid=9

    You could also hack the PK2 code, it's open source and really well documented.

    It's up to you

    It's also easy to do in VB or C#, lots of example 'round the web. The Express version are free for non-profit use.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  11. #11
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default Re: PK2 UART tool

    Here is some old stuff I was helping some kids with.
    Look at the "liberty" code "remote..." if you go the Liberty route.
    http://mackrackit.com/mac/www/dave/basic.html
    Dave
    Always wear safety glasses while programming.

  12. #12
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869

    Default Re: PK2 UART tool

    The weather station looks almost perfect as is. Accepts a stream from com port and puts the data in the boxes.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  13. #13
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818

    Default Re: PK2 UART tool

    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  14. #14
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,810

    Default Re: PK2 UART tool

    If you use the Bray++ Terminal, then simply by setting a Rx Clear character, your Receive window is instantly cleared!

    That simple. No coding, no special ANSI codes, no nothing.

    Just send from your PIC a character, whatever you do no use normally and off you go!

    Download from here:
    https://sites.google.com/site/termin...attredirects=0

    Ioannis

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts