摘要 |
PURPOSE: A method for converting binary data into ASCII data in a serial interface is provided to convert and transmit binary data into the ASCII data within a printing character range capable of being transmitted and received in a serial interface communication. CONSTITUTION: A continuous stream of binary data is cut 6-bit by 6-bit. The cut data are added to 2-bit data and forms 8-bit data(S310). A set value(0x2F) is added each cut data row(S320). A data row of a range from 0x2F to 0x6E is converted from binary data into ASCII data(S330). A transmission side transmits the converted ASCII data through a serial interface and a receiving side receives the ASCII data. At this time, the ASCII data belongs to a printing character range(0x20-0x7E)(S340). The receiving side subtracts 0x2F from each octet unit of a received ASCII data stream(S350). Thus, a 8-bit octet unit data row is formed, a 6-bit value of the latter half of each data row is taken, a connection of 8-bit is executed, and thus the binary data are restored(S360).
|