0

Sending and receiving hex on HD410



Hello: I am using a HD-8x8 board from HMS Electronics. I have 6 pushbuttons connected to the inputs, and 6 LED's connected to the outputs. The hardware tests out fine. The problem I am having deals with the fact that the HMS board doesn't speak ASCII. For example, when button #1 is pressed, it sends out <h01>, button 2 sends <h02> button 3 sends <h04>, button 4 sends <h08> etc. To turn on the outputs, the same hex data must be sent e.g. sending <h01> turns on output 1, <h10> (decimal 16) turns on output 5. So, I need to find a way of getting a HD410 to send the hex values to turn on the lights, while at the same time receiving hex bytes to control the playing of the videos. Any suggestions would be much appreciated. Thanks again,

8 comments

  • 0
    Avatar
    RokuLyndon


    I thought on the 8x8, that all 8 inputs were passed through to gpio, and only the outputs required hex. Is that not the case?
  • 0
    Avatar
    Michael / ampex351


    " thought on the 8x8, that all 8 inputs were passed through to gpio, and only the outputs required hex. Is that not the case?

    Hello Lyndon:

    HNMS does have such a product that uses the GPIO for inputs, and serial for the outputs.  However the model I have is all serial, both in and out.  I've used the <send serial byte> to send from the HD410 to the HMS, but I'm still having a problem getting the HD410 to accept bytes from the HMS.  As i mentioned, the HMS is hard-coded to only respond to non-printing characters, sending <h01>, <h02>, <h04>, <h08>, <h16>, <h32> <h64> and <h128> corresponding inputs 0 through 7 on the HMS board.

    Thanks for your attention,  Michael Callahan / Museum Technology
  • 0
    Avatar
    RokuLyndon


    Please send me the autorun from brightauthor that you are using. I can modify the autorun to receive bytes. I can also tell you where to make the changes in the autorun as well. if you make the following changes, to your autorun.brs, your unit will listen for bytes. The bytes received are received as their decimal values. For hex values below 10, they are the same as decimal.

    SO, to receive h02, you would just enter "2" as the serial event coming in. no quotes.

    1. Change the line before "return" in the function below from SetLineEventPort to SetByteEventPort.

    Sub CreateSerial()

       m.serial = CreateObject("roSerialPort", 0, m.serialPortSpeed)
       if type(m.serial) <> "roSerialPort" then print "Error creating roSerialPort" : stop
       ok = m.serial.SetMode(m.serialPortMode)
       if not ok then print "Error setting serial mode" : stop
       m.serial.SetByteEventPort(m.msgPort)
       
       return
       
    End Sub




    2. Change the type of message from roSTreamLineEvent to roStreamByteEvent

           elseif type(msg) = "roStreamByteEvent" then
           
               eventData = m.HandleStreamLineEvent(msg, eventData, transitionList)




    3. Finally, change from

    serialEvent$ = msg.GetString()

    to the following:

               serialEvent$ = mid(str(msg),2)


  • 0
    Avatar
    Michael / ampex351


    "Please send me the autorun from brightauthor that you are using. I can modify the autorun to receive bytes. I can also tell you where to make the changes in the autorun as well. if you make the following changes, to your autorun.brs, your unit will listen for bytes. The bytes received are received as their decimal values. For hex values below 10, they are the same as decimal.

    SO, to receive h02, you would just enter "2" as the serial event coming in. no quotes.

    Hi Lyndon:

    Thanks very much for the reply.  I edited the autorun per your example, and it's getting close, but not quite there.  Upon boot, it goes to the correct image, but still isn't responding to the serial buttons.  Connecting the 410 to RealTerm, I can get some files to play by sending ASCII with a CR, but it doesn't respond to straight hex.  When I can get it to play via RealTerm, it does send back <00> upon video end, which is what it should be doing.

    I hope I didn'tg make some stupid error in editing the file.  I'm emailing you the BA file, <project_2>
  • 0
    Avatar
    Michael / ampex351


    Hello Lyndon:

    Many thanks for the reply.  I edited the autorun file per your example.  Upon boot, the correct slide is displayed, but it will still not respond to signals from the HMS serial board.  Looking at the HMS board output with RealTerm, it is sending out what is expected:  <00> for button 1,  <01> for button 2 etc.  

    Hooking the HD410 up to RealTerm, I can get it to play the files, although not reliably.  Sending straight hex doesn't work, but when I send ASCII with a CR is sometimes works.

    I'd like to take you up on your kind offer, and am emailing you the BA file.

    Thanks again,  Michael
  • 0
    Avatar
    Michael / ampex351


    hello Lyndon:

    I'm not sure how to send you the autorun file.  Can I do it within the forum, or should it be a separate email attachment?

    Thanks,  Michael
  • 0
    Avatar
    RokuLyndon


    I sent an autorun for you to test
  • 0
    Avatar
    Michael / ampex351


    by RokuLyndon » Thu Mar 10, 2011 5:36 pm

    I sent an autorun for you to test




    Thanks Lyndon.  I'll be testing it this eveing.  Thanks again,  Michael
Please sign in to leave a comment.