Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Hardware & Devices
  4. Sending 5-bit Baudot Over Serial

Sending 5-bit Baudot Over Serial

Scheduled Pinned Locked Moved Hardware & Devices
csharphardwaretestingbeta-testinghelp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ricecake
    wrote on last edited by
    #1

    Can anybody help me in implementing a method to send 5-bit Baudot codes over a serial port? I have an application that must communicate with a piece of hardware that sends 5-bit Baudot data, so I am building a simulator to run on a different computer to send the same format data to our receiving PC for testing. The simulator is written in C# using .NET 2.0, so I am utilizing the System.IO.Ports.Serial interface. I can send and receive the data as 8-bit with no problems at all. The receiving PC has a serial card that does support 5-bit communications. In the implementation, I tried manually doing the encoding to Baudot and sending it as 8-bit using the trick given here: http://graffiti.virgin.net/ljmayes.mal/baud/baud.htm[^] (bitwise OR'ing each character with 0xE0 to set the 3 MSBs to 1, which should simulate sending multiple stop bits). However, on the receiving end, when I set it to 5 bits, I just get a bunch of boxes in the terminal output, and when I set it to 8 bits, I get gibberish characters. I'm not sure if I need to set the encoding to UTF8 or ASCII, or if it even makes a difference since I am using the SerialPort.Write() method that takes in a Byte[], offset, and length. I have tried setting it to both ways and it didn't work. Has anybody done anything like this before, or has any ideas on how to implement it? Thanks.

    -- Marcus Kwok

    J 1 Reply Last reply
    0
    • R ricecake

      Can anybody help me in implementing a method to send 5-bit Baudot codes over a serial port? I have an application that must communicate with a piece of hardware that sends 5-bit Baudot data, so I am building a simulator to run on a different computer to send the same format data to our receiving PC for testing. The simulator is written in C# using .NET 2.0, so I am utilizing the System.IO.Ports.Serial interface. I can send and receive the data as 8-bit with no problems at all. The receiving PC has a serial card that does support 5-bit communications. In the implementation, I tried manually doing the encoding to Baudot and sending it as 8-bit using the trick given here: http://graffiti.virgin.net/ljmayes.mal/baud/baud.htm[^] (bitwise OR'ing each character with 0xE0 to set the 3 MSBs to 1, which should simulate sending multiple stop bits). However, on the receiving end, when I set it to 5 bits, I just get a bunch of boxes in the terminal output, and when I set it to 8 bits, I get gibberish characters. I'm not sure if I need to set the encoding to UTF8 or ASCII, or if it even makes a difference since I am using the SerialPort.Write() method that takes in a Byte[], offset, and length. I have tried setting it to both ways and it didn't work. Has anybody done anything like this before, or has any ideas on how to implement it? Thanks.

      -- Marcus Kwok

      J Offline
      J Offline
      Jonathan Davies
      wrote on last edited by
      #2

      Though I've no experience of Baudot, I'd recommend you use a port monitoring program e.g. Portmon to obtain a lot more information about whats happening at the port. Though you currently see: "boxes in the terminal output ...gibberish characters"; It just might be the case that you can glean some information from the values of these characters when viewed in hex. Being able to see the way received/sent bytes are grouped and port control codes helps a great deal as well.

      R 2 Replies Last reply
      0
      • J Jonathan Davies

        Though I've no experience of Baudot, I'd recommend you use a port monitoring program e.g. Portmon to obtain a lot more information about whats happening at the port. Though you currently see: "boxes in the terminal output ...gibberish characters"; It just might be the case that you can glean some information from the values of these characters when viewed in hex. Being able to see the way received/sent bytes are grouped and port control codes helps a great deal as well.

        R Offline
        R Offline
        ricecake
        wrote on last edited by
        #3

        Thanks for the tip. I looked at the PortMon tool and it looks like it might be very helpful in diagnosing what is going on. If I manage to get it working, I will post here for the archives.

        -- Marcus Kwok

        1 Reply Last reply
        0
        • J Jonathan Davies

          Though I've no experience of Baudot, I'd recommend you use a port monitoring program e.g. Portmon to obtain a lot more information about whats happening at the port. Though you currently see: "boxes in the terminal output ...gibberish characters"; It just might be the case that you can glean some information from the values of these characters when viewed in hex. Being able to see the way received/sent bytes are grouped and port control codes helps a great deal as well.

          R Offline
          R Offline
          ricecake
          wrote on last edited by
          #4

          Thanks for the PortMon tip, using the tool I was able to see that the machine was receiving what I had expected. It appeared that the values were being received properly, but then I found out that the software was expecting the data to be encoded differently than what I thought had to be sent. I also suspect that the terminal program only recognized ASCII encoding and not Baudot, so it was not able to decode the message into plain text. Thanks for your help. It seems that the ultimate solution to my problem is application-specific.

          -- Marcus Kwok

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups