Click here to Skip to main content
15,888,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Presently data is going serially in the form of 8 bits now i want to send it on 5 bits on 50 bps
Posted

That's complicated: if you mean you want to send 5 bits per character as text-type data, then look at using Base64[^] - depending on what your framework is, there are various ways to convert to / from base64:

Google: Base64[^]
If you apop uses the .NET framework, then these are available:
Convert.ToBase64[^]
Convert.FromBase64[^]
 
Share this answer
 
As Griff says, go for the principle of Base64. Note that this is a method for transposing an array of 8-bit characters into an array of 6-bit characters, so you will have to implement your own solution to transpose into 5-bit characters.

Simply put, you take five 8-bit characters, put them together in one integer of sufficient length (e.g. at least 40 bits, which effectively means a 64-bit integer) and read out five bits at a time, to form eight 5-bit characters. On the other end, you reverse the process.

Now, as for how to transfer 5-bit characters at 50 bps, that depends entirely on the operating system, and the serial hardware. There are limitations in what various UARTs and other communication chips accept.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900