Shop OBEX P1 Docs P2 Docs Learn Events
connect basic stamp to hp 50g calculator — Parallax Forums

connect basic stamp to hp 50g calculator

mklrobomklrobo Posts: 420
edited 2014-07-06 09:46 in General Discussion
I would appreciate any help in solving the connection from the basic stamp (bs2p) to the
hp 50 or 49 hp calculator. Direct rs-232 and usb does not work. Used usb to serial conversion
board, no effect. The rewards for doing this is great; the stamp gathers/controls data to/from
the calculator. The calculator can take data and extrordinary processing to perform diagnostic/control
commands. This "avatar" can be the perfect diagnostic tool, and possibilities unlimited!
Thanks for your help.
«134

Comments

  • kwinnkwinn Posts: 8,697
    edited 2014-01-23 15:40
    What sort of input/output connection does the HP 49/50 have available?
  • mklrobomklrobo Posts: 420
    edited 2014-01-23 15:55
    kwinn wrote: »
    What sort of input/output connection does the HP 49/50 have available?

    It has an infrared, mini - USB, mini - serial. I have viewed output from the serial on my PC oscilloscope.
    Tried to "hack" the data, running data match for used protocol. have not located one yet. I appreciate your
    inquiry. This uses of this type of circuit will make the star trek tricoder look like a peanut whistle.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2014-01-23 16:25
    Check this out:

    hp49/docs/misc/
    in particular:
    Universal Lab Interface Software Developer's Guide

    It is probably 9600 baud with software handshake.

    I don't know about signal polarity.

    Duane J
  • mklrobomklrobo Posts: 420
    edited 2014-01-23 18:02
    Good information. :smile: 9600 baud is right, I think. I will use the info you have presented. I
    have not used the protocol language in the link you indicated before. Look forward to
    using it! Thanks again.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-23 22:04
    My HP50gx defaults to 115,200 baud, maybe too fast for BS2 without resetting the i/o file parameters. And there are quite a few options in the Flags that need to be understood and set to get good results. Start with a loopback to be sure you have them working.

    Can't find a document that explains all these.
  • mklrobomklrobo Posts: 420
    edited 2014-01-24 06:15
    :smile: Thanks for your information. I can set the baud rate and type of protocol in the File transfer in the menu portion of
    the "tools" button. I have not been able to run a program from hpcalc.org, at this time. Hpcalc.org has alot of instructions
    of the programming functionality of the calculator. When running a dedicated program, I assume, I will have to set
    baud rate/protocols in the program. protocols in my 50g are Kermit and Xmodem. I think Xmodem is more user
    friendly, mainly because it has been used so widspread, and is old as the hills. There was a basic stamp article
    that let the stamp "talk" over an Xmodem dedicate chip. I will have to find that...? I appreciate your help.
    Your work on this can be benificial to you... examples of uses - oscilloscope, spectoanalysis, robot control, Rapid
    Math Model Integrator, and universal diagnostic tool. Cheaper than a laptop, with the power of Mathcad! excellent for
    field repair uses. use on cars, printers, planes, trains, anything that requires electronic repair. Need another program
    in the field? jsut download one from your home computer, or use an SD card, on the 50g!

    Thanks again for your help!
  • mklrobomklrobo Posts: 420
    edited 2014-01-24 07:19
    :cool: Will try the loopback solution, to verify that my calculator is at least sending data, and that
    it is clean. I will try to use the File transfer method to just send and recieve data through whatever
    process that i can discover that will work. I will try to pass a letter or a number through first, back
    and forth. If that works, larger data packets can be sent. There "should" be a common protocol
    used, because, the hp50g can communicate to a computer via serial port. RS-232 and or IC2 is the electronic
    protocol, and kermit and/or Xmodem is the data protocol, right? If so, the basic stamp must use a
    common protocol to communicate with the computer. I would assume it would be the simplest one,
    in order to NOT to consume physical memory on the main chip. - ?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-24 08:18
    Hi again,
    Another fellow on the forum wants to use an HP-48 calculator's serial with Forth on the Propeller. To help out, I ordered a serial cable for my HP-50gx. But since I am in Taiwan and payment had to be sent by mail, I may not get it in less than 4 weeks.

    I stated reading about the RS232 serial port on the HP and looking for configurtion items. But the documentation doesn't mention if there is any special handshaking protocol.

    After a physical loopback test, you might try using a serial terminal program on a PC to snoop what it might be sending. And to try sending. That may save a lot of time as you won't have to write test code in the BasicStamp.

    In fact, if you are using Windows... the Hp50g may have a Windows application that will at least confirm you have a useful communications link.

    RealTerm will be a great help if you have to decode handshaking. And it is FREE.

    There are a lot of Terminal Emulators with will provide Kermit and Xmodem support for free as well. Get these features running with a regular PC. The BasicStamp doesn't have a file transfer capablity and is rather bare bones. SO the work will be to slowly strip out the stuff that makes it complex.

    http://realterm.sourceforge.net/

    http://en.wikipedia.org/wiki/List_of_terminal_emulators
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2014-01-24 08:34
    Hi Loopy;
    I stated reading about the RS232 serial port on the HP and looking for configurtion items. But the documentation doesn't mention if there is any special handshaking protocol.
    The documentation I read said the serial did use software handshaking.
    I.e.
    Baud Rate: 300 to 38,400 baud (any rate in this range will work)
    Word Length: 8 bits (8 data bits)
    Parity: None
    Stop Bits: 1
    Handshake: X-on/X-off (<Ctrl>+Q/<Ctrl>+S)

    Duane J
  • mklrobomklrobo Posts: 420
    edited 2014-01-24 09:12
    :nerd: Alot of awesome info! I have tried to hook up a hp49 to hp50 via mini-usb & serial directly,
    and they would not communicate. Only through the infrared. I ordered the cable for the 50g,
    that was made by a private person. It did not work, and it was recommended by the 50g
    software. I was hoping it would be plug and play, but there must be something more to it.
    Once the data communication problem is solved, the rest will be simple.(I hope)
    Good work! The solution seems to be close!
  • mklrobomklrobo Posts: 420
    edited 2014-01-24 10:24
    Hi again,
    Another fellow on the forum wants to use an HP-48 calculator's serial with Forth on the Propeller. To help out, I ordered a serial cable for my HP-50gx. But since I am in Taiwan and payment had to be sent by mail, I may not get it in less than 4 weeks.

    I stated reading about the RS232 serial port on the HP and looking for configurtion items. But the documentation doesn't mention if there is any special handshaking protocol.

    After a physical loopback test, you might try using a serial terminal program on a PC to snoop what it might be sending. And to try sending. That may save a lot of time as you won't have to write test code in the BasicStamp.

    In fact, if you are using Windows... the Hp50g may have a Windows application that will at least confirm you have a useful communications link.

    RealTerm will be a great help if you have to decode handshaking. And it is FREE.

    There are a lot of Terminal Emulators with will provide Kermit and Xmodem support for free as well. Get these features running with a regular PC. The BasicStamp doesn't have a file transfer capablity and is rather bare bones. SO the work will be to slowly strip out the stuff that makes it complex.

    http://realterm.sourceforge.net/

    http://en.wikipedia.org/wiki/List_of_terminal_emulators




    When we solve this problem, we can solve the communication problem for the HP 48 to the propeller. Solve one, solve both.
    Thanks for your help.
  • mklrobomklrobo Posts: 420
    edited 2014-01-24 11:00
    :nerd: opened up the 48 g, and traced the circuit from the serial port. The serial port also feeds the
    infrared port. the infrared must (i assume) must be modulated before riding on the infrared.
    Thanks.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-24 11:08
    There are Flags that toggle between the IR serial i/o and the hardwire serial i/o. If the IR is selected, no hardwire will be active.

    Regarding Xmodem and Kermit, I avoid both of these in my Minicom configuration when I use the Propeller in Forth. Unless the connected device specifically wants a modem protocol, it would be likely that you want none.

    Xon/Xoff might also be a feature that can be toggled on and off. I wonder if the 'server' selection on the HP calculator is really equivalent to a 'terminal' that sends output from the keyboard, and receives input to the display.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-24 11:15
    Hi Loopy;
    The documentation I read said the serial did use software handshaking.
    I.e.
    Baud Rate: 300 to 38,400 baud (any rate in this range will work)
    Word Length: 8 bits (8 data bits)
    Parity: None
    Stop Bits: 1
    Handshake: X-on/X-off (<Ctrl>+Q/<Ctrl>+S)

    Duane J

    I am not certain that the Universal Lab Inferface serial specifications are as versitle as the HP-48,49,50. For example, I am sure I can get 115,200 baud. But what I can't get is a simple and clean explaination from HP on how to use the serial port. I have all teh original documentation for my HP-50gx, including a 848 page PDF. These guys loved to write, but it was all about the math functions. the programing modes, the display modes. and such. When it cam to i/o, they suggested you download a Windows package to work with the calculators i/o.

    IOW, it seems they wanted to keep the whole interface proprietary and not allow generic hookups.

    What little I have discovered is that the serial interface has 4 wire - ground, Tx, Rx, and V+.

    The Tx and Rx are 3.3v logic signal that need to go through a MAX3232 to invert them for normal RS-232. But you can still do a loopback by jumping Tx to Rx directly and without a lot of external wiring.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-24 11:41
    I found a new document here http://www.hpcalc.org/hp49/docs/misc/ --- but you must scroll down to locate it.

    The HP50g Advanced User's Reference - Edition 2. Go to the Index at the back of the 600 plus pages and see the section on serial communications.

    It seems to apply to the HP48, HP49, and the HP50.

    This is useful and stuff I was NOT aware of.

    And a more direct link ... http://www.hpcalc.org/details.php?id=7141
  • mklrobomklrobo Posts: 420
    edited 2014-01-24 12:01
    :smile: great info! I have a 3.3Volt usb converter board, I will try that. Still, if the data protocol
    is not matching(handshaking), it still will not work. I have had problems with the protocol matching, and so that is
    why I had originally started "hacking" the data stream.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-24 12:08
    There are two bugs in the serial communication for the HP-49 that are mentioned amongst all the documents listed. The one that most concerns me is in Spanish. It seemed to clean up poor data transmission quality.

    Also, take a look at the document on building your own serial cable.

    Gawd, HP just makes things so complex.

    You do realize that the BasicStamp2 is able to directly take inverted serial signals, don't you? And it might even handle the 3.3v logic directly.
  • mklrobomklrobo Posts: 420
    edited 2014-01-24 12:38
    :cool: Yes, HP makes it difficult. The only reason that I picked hp for this project, is because of the extensive
    library, and the processing power of the calculator. I would like to use any calculator that would fit the
    solution, but which one is compatable, and has the raw processing power?
    I will keep plugging along, to try to find the solution. TI is alot friendlier, but lacks the processing power.
  • mklrobomklrobo Posts: 420
    edited 2014-01-24 18:25
    :blank: tried to find info on TI - 85 interface to stamp, no results. Must find a process to
    verify protocols that match the documentation. Does anyone know what protocols the
    bs2p stamp uses in IC2 and serial out mode?:innocent:
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-25 08:53
    The BasicStamp Manual has an extensive section of its RS232 protocol abilities. You can get a free download of it from Parallax. The main issues are it is half-duplex and the buffers are quite small. The Propeller is able to do full-duplex serial and larger buffers. Also, since the Propeller is a 3.3v device.. you might do ttl-to-ttl directly and not bother with the up and down of inserting RS232 driver chips.

    I have weeks to wait for a cable, so at this point I really can't do much more to help you. Besides, I have an HP-50gx with updated firmware. I am not sure I can offer much real advise on the older versions.
  • mklrobomklrobo Posts: 420
    edited 2014-01-25 09:48
    :lol:
    I appreciate your help. If we can crack this problem, the rewards are great. I can program in
    "C", so I am going to try to identify the protocol via live data train capture. Getting data to/from
    calculator is going to be real trick. Once again, I appreciate your help in this daunting problem.:smile:
  • mklrobomklrobo Posts: 420
    edited 2014-01-25 09:51
    If the propeller is more efficent, and can access the calculator, I would not mind switching to
    that. I bought the stamps for this purpose. Thanks.
  • mklrobomklrobo Posts: 420
    edited 2014-01-25 21:41
    Hi Loopy;
    The documentation I read said the serial did use software handshaking.
    I.e.
    Baud Rate: 300 to 38,400 baud (any rate in this range will work)
    Word Length: 8 bits (8 data bits)
    Parity: None
    Stop Bits: 1
    Handshake: X-on/X-off (<Ctrl>+Q/<Ctrl>+S)

    Duane J

    :smile: I could verify the data transmission, if I could intercept a clean data train. I could get the data from the
    serial or infrared. The infrared could be cleaner, and would allow an easier hookup, with no hardwire.
    Thanks.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-26 00:01
    Well, there are really two seperate modes of serial tranfer ---- Character by character, and a Block of characters by Block of characters.

    I suspect the IR in the HP calculator is IRDA. And that is intended to transfer blocks of data, often with file names. On the other hand, the BasicStamp is very much a character by character device.

    Linux has an IRDA project that might help, but it is a lot more complex to do IRDA than it is to do either simple IR remote control or character-by-character transfers. The use of Kermit supports block-by-block data transfers.

    http://irda.sourceforge.net/
    http://www.lirc.org/

    If you are developing your own code, starting with character-by-character transfers is best. Later you can learn about blocks as these require more computer resources. I am not sure that anyone has developed IRDA software for the Propeller. It won't work on the BasicStamp.
  • mklrobomklrobo Posts: 420
    edited 2014-01-26 16:26
    Good information! I did not see this potential problem. Your information suggests that a datalogger must be inplace, to
    supply the correct data train time/sequence info. This would be a "buffer", to ensure that both devices are satisfied with
    the data passed. This should stop possible data collisions, lost data, and unexpected "shifts" in the pulse train.
    Wow, great info!
  • mklrobomklrobo Posts: 420
    edited 2014-01-26 16:34
    Well, there are really two seperate modes of serial tranfer ---- Character by character, and a Block of characters by Block of characters.

    I suspect the IR in the HP calculator is IRDA. And that is intended to transfer blocks of data, often with file names. On the other hand, the BasicStamp is very much a character by character device.

    Linux has an IRDA project that might help, but it is a lot more complex to do IRDA than it is to do either simple IR remote control or character-by-character transfers. The use of Kermit supports block-by-block data transfers.

    http://irda.sourceforge.net/
    http://www.lirc.org/

    If you are developing your own code, starting with character-by-character transfers is best. Later you can learn about blocks as these require more computer resources. I am not sure that anyone has developed IRDA software for the Propeller. It won't work on the BasicStamp.



    Awesome! The suggestion would give a specific purpose for the datalogger. Once the datalogger is designed for that specific calculator, it could be used for
    a buffer for other similar purposes.
  • mklrobomklrobo Posts: 420
    edited 2014-01-26 16:59
    Well, there are really two seperate modes of serial tranfer ---- Character by character, and a Block of characters by Block of characters.

    I suspect the IR in the HP calculator is IRDA. And that is intended to transfer blocks of data, often with file names. On the other hand, the BasicStamp is very much a character by character device.

    Linux has an IRDA project that might help, but it is a lot more complex to do IRDA than it is to do either simple IR remote control or character-by-character transfers. The use of Kermit supports block-by-block data transfers.

    http://irda.sourceforge.net/
    http://www.lirc.org/

    If you are developing your own code, starting with character-by-character transfers is best. Later you can learn about blocks as these require more computer resources. I am not sure that anyone has developed IRDA software for the Propeller. It won't work on the BasicStamp.

    Since the data buffer will be needed, that would explain why other attempts failed. Unless there is a datalogger, correct data trasmission would be
    problematic. Also may function as a "translator", and could be used with other calculators. This may offer a solution with the propeller problem you were involved with.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-26 20:10
    Hewlett-Packard provides supporting software in Windows and Apple OSes.

    This really starts with a hack. And the two ways to do so seem to either attempt [a] a loopback, or set up an RS232 cable that is Y-cable to snoop the communications between a computer that works with the communication application software.

    The RealTerm software would allow a second computer to snoop the dialog between the HP calculator and its application on a PC.

    After you get some idea of how the exchanges are working, the way to get what you want will be a lot clearer.

    I just can't do any of this until I get a cable for my HP-50gx, not even the loopback.
  • mklrobomklrobo Posts: 420
    edited 2014-01-27 15:05
    :cool:
    cool! If you do not recieve the cable, I have one that I bought, supposed to have worked, but did not. You can have it, (free),
    although, like I say, I could not get it to work for me. Serial port of calculator to serial (9 pin) port to computer.
    I will start on building the system, serial documentation on stamp, datalogger parameters and dedicated translater program,
    and analyze the calculator's data train. I appreciate your help. :smile:
  • mklrobomklrobo Posts: 420
    edited 2014-01-27 17:30
    The BasicStamp Manual has an extensive section of its RS232 protocol abilities. You can get a free download of it from Parallax. The main issues are it is half-duplex and the buffers are quite small. The Propeller is able to do full-duplex serial and larger buffers. Also, since the Propeller is a 3.3v device.. you might do ttl-to-ttl directly and not bother with the up and down of inserting RS232 driver chips.

    I have weeks to wait for a cable, so at this point I really can't do much more to help you. Besides, I have an HP-50gx with updated firmware. I am not sure I can offer much real advise on the older versions.

    :cool: maybe the propeller is the chip to use for a datalogger/translater function. I will review the advantages of stamp/propeller in reference to the needed purpose. Thanks.
Sign In or Register to comment.