Shop OBEX P1 Docs P2 Docs Learn Events
SEROUT and Hyperterminal and the BS2 — Parallax Forums

SEROUT and Hyperterminal and the BS2

agentileagentile Posts: 101
edited 2005-03-19 17:18 in BASIC Stamp
Hello,
· I am trying to use SEROUT and Hyperterminal to take data that has been written in EEPROM and put it into a text file.· I have had no problem getting hyperterminal to receive data.· The data dumps onto the hyperterminal page perfectly.· But when I use "capture text," the resulting text file is full of alias characters.· I have tried several transfer rates.· All of the various transfer rates work perfectly well on the hyperterminal screen.· It is only when I try to use the "capture text" option that I have difficulty in data transfer.· And one other thing, if I open the saved text file in the stamp editor, it looks almost perfect (the document is double spaced instead of single spaced).· I would like to open the files in Notepad.· So, my conlcusion is that the data transfer is taking place without error; the problem lies in getting the data into Notepad.· Has anyone encountered this problem?· Any suggestions?

thanks,
agentile

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-03-19 04:14
    agentile,

    ·· Have you tried copying and pasting into a notepad document instead of using, "capture text?"

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Tech Support
    csavage@parallax.com
  • agentileagentile Posts: 101
    edited 2005-03-19 05:56
    Chris,

    ·I haven't tried cutting and pasting.· I am sure it would it work, but I am trying to·figure out how to create a text file with my·BS2·without having to resort to cutting and pasting.· I am sure that this has been done.· It is my guess that there is some sort of formatting issue with Notepad.· I would settle for dumping the data into an Excel file, but I wouldn't even know how to begin calling row and column numbers.· Any ideas?



    agentile



    ·
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-03-19 06:38
    agentile -

    Would you please post the SEROUT command you are using, and the parameters used in hyperterminal. As a pure guess, I'd say it might be a mis-matched parity (N, 1, 2) or incorrect number of bits (7 vs. 8) problem. Looks good, tastes terrible, runs fine are typical characteristics of problems like that.

    Regards,

    Bruce Bates
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-03-19 07:59
    agentile,

    ·· Without knowing exactly what you're sending, I couldn't guess as to the problem, which is why I suggested trying copy/paste, since that would answer at least one question.· Bruce is correct in that we'd need to see your code to be sure it's not simply something you're sending that's hosing the data.

    ·· It's kind of like in DEBUG, when you try sending data there...Things can start looking good, then suddenly the screen goes crazy because of a control character that was sent instead of it's DEC or HEX value.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Tech Support
    csavage@parallax.com
  • NewzedNewzed Posts: 2,503
    edited 2005-03-19 13:03
    Agentile, I have done this many times, except I always capture the file to Excel.· I prefer Excel to Notepad because Excel is so easy to handle.· If you do not get your problem solved, let me know and I will guide you through the process.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    NEW! 4 MB EEPROM

    http://hometown.aol.com/newzed/page4.html
    ·
  • agentileagentile Posts: 101
    edited 2005-03-19 14:36
    Sid,

    ·Thanks for your suggestion.· Under capture text, I entered a file name with an xls extension.· This dumped the data perfectly.· Now I would like to add one thing to this project.· I would like to be able to be able to include a header.· So, I would like to dump something like:

    Data From 3/19/05


    1·· 5.67

    2· 7.89·

    etc.



    I now can easily get the columns of data.· How do I also get the header?· Is it possible to use a template file?



    thanks,

    agentile
  • NewzedNewzed Posts: 2,503
    edited 2005-03-19 15:00
    Agentile, do what I do.· Once I get the data into Excel, I simply insert the column headers.· You may have to insert a row to get the necessary room.· This is a lot easier - and a lot more flexible - that trying to insert headers in your data program.· Instead of the .xls extension, you might try using a .prn extension for your Excel file.· A .prn file is one that is delimited with spaces as opposed to tabs or commas.· It makes setting your columns much easier.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    NEW! 4 MB EEPROM

    http://hometown.aol.com/newzed/page4.html
    ·
  • agentileagentile Posts: 101
    edited 2005-03-19 15:31
    Sid,

    ·I have figured out the headers.· It's not so bad.· If I separate my columns of data by the command SEROUT 16,rate,[noparse][[/noparse]9] (9 of course means ascii tab), then my header gets treated as a single chunk of data, and doesn't get broken up.· But, I have another question.· Some of my data is larger than 1 byte.· Hyperterminal will only allow me to send one byte at a time.· How can I get the number 289 to hyperterminal?



    thanks,

    agentile
  • NewzedNewzed Posts: 2,503
    edited 2005-03-19 15:44
    Agentile, I just wrote the following little program:

    ' {$STAMP BS2p}
    ' {$PBASIC 2.5}
    baud CON 16624
    x VAR nib
    start:
    FOR x = 1 TO 5
    SEROUT 16, baud, [noparse][[/noparse]DEC 300, 13]
    PAUSE 500
    SEROUT 16, baud, [noparse][[/noparse]DEC 15000, 13]
    PAUSE 500
    NEXT

    It displays the numbers perfectly.· Hyper will receive anything the Stamp sends.· Are you declaring your variables as word instead of byte?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    NEW! 4 MB EEPROM

    http://hometown.aol.com/newzed/page4.html
    ·
  • agentileagentile Posts: 101
    edited 2005-03-19 17:18
    Sid,

    I had forgotten to declare my character variable as a word.· Thanks again.



    agentile
Sign In or Register to comment.