ASCII serial port crib sheets

ASCII serial port crib sheets

Tronisoft Limited Email: sales@tronisoft.com Web: w.tronisoft.com

ASCI // Serial Port Crib Shets

Handy basic ASCI,, serial // RS232 port information and decimal//hheexxaadecimal conversion chart

Information furnished is believed to be accurate and reliable. However, Tronisoft Limited assumes no responsibility, consequential or otherwise of use of such information. Email support@tronisoft.com with suggestions or to report document inaccuracies, omissions and errors.

Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all information previously supplied.

© Copyright 2007 Tronisoft Limited - United Kingdom - All Rights Reserved. http://www.tronisoft.com

P/N: 9660 Document version: 1.01 Date: August 2007

Advanced Data Capture and Control Systems

ASCI // Serial Port Crib Shet

ASCII_serial_port_crib_sheets.doc, © Copyright 2007 Tronisoft Limited. All Rights Reserved. 1

ASCII Chart

ASCII, the American Standard Code for Information Interchange, was developed in the 1960's as a standard 7-bit code for identifying letters, numbers, symbols, and special characters in the English language. It was later expanded (as Extended ASCII) to include additional symbols and foreign language characters. Standard ASCII consists of 128 characters, ranging from 0 to 127 which can be broken down into the following subgroups:

0 to 31, 127: Control codes (includes null, backspace, line feed and others) 32 to 47, 58 to 64, 81 to 86, 123 to 126: Punctuation marks, mathematical (and other) symbols 48 to 57: Numbers 0 through 9 65 to 80: Capital letters A through Z 87 to 122: Lower case letters a through z

Standard ASCII Chart

The standard chart includes the ASCII character or control and their related decimal and hexadecimal values. Also shown are the control key sequences for the control codes. Note, to obtain codes 0 to 31, console Control Key is pressed while simultaneously pressing a Letter Key, e.g. J is the line feed character. Control Key subtracts decimal 64 (40h) from Letter Key pressed.

Legend: Key - Control Key + Letter Key combination except 30 (1E hex) = Control +caret.

Dec Hex Key ASCII Dec Hex ASCII Dec Hex ASCII Dec Hex ASCII 0 0 @ NUL (Null) 32 20 (Space) 64 40 @ 96 60 ` 1 1 A SOH (Start of Heading) 3 21 ! 65 41 A 97 61 a 2 2 B STX (Start of Text) 34 2 " 6 42 B 98 62 b 3 3 C ETX (End of Text) 35 23 # 67 43 C 9 63 c 4 4 D EOT (End of Transmission) 36 24 $ 68 4 D 100 64 d 5 5 E ENQ (Enquiry) 37 25 % 69 45 E 101 65 e 6 6 F ACK (Acknowledgement) 38 26 & 70 46 F 102 6 f 7 7 G BEL (Bell) 39 27 ' 71 47 G 103 67 g 8 8 H BS (Backspace) 40 28 ( 72 48 H 104 68 h 9 9 I HT (Horizontal Tab) 41 29 ) 73 49 I 105 69 i 10 A J LF (Line Feed) 42 2A * 74 4A J 106 6A j 1 B K VT (Vertical Tab) 43 2B + 75 4B K 107 6B k 12 C L F (Form Feed) 4 2C , 76 4C L 108 6C l 13 D M CR (Carriage Return) 45 2D - 7 4D M 109 6D m 14 E N SO (Shift Out) 46 2E . 78 4E N 110 6E n 15 F O SI (Shift In 47 2F / 79 4F O 1 6F o 16 10 P DLE (Data Line Escape) 48 30 0 80 50 P 112 70 p 17 1 Q DC1 (Device Control 1) 49 31 1 81 51 Q 13 71 q 18 12 R DC2 (Device Control 2) 50 32 2 82 52 R 114 72 r 19 13 S DC3 (Device Control 3) 51 3 3 83 53 S 115 73 s 20 14 T DC4 (Device Control 4) 52 34 4 84 54 T 116 74 t 21 15 U NAK (Negative Ack.) 53 35 5 85 5 U 117 75 u 2 16 V SYN (Synchronous Idle) 54 36 6 86 56 V 118 76 v 23 17 W ETB (End of Transmit Block) 5 37 7 87 57 W 119 7 w 24 18 X CAN (Cancel) 56 38 8 8 58 X 120 78 x 25 19 Y EM (End of Medium) 57 39 9 89 59 Y 121 79 y 26 1A Z SUB (Substitute) 58 3A : 90 5A Z 122 7A z 27 1B [ ESC (Escape) 59 3B ; 91 5B [ 123 7B { 28 1C \ FS (File Separator) 60 3C < 92 5C \ 124 7C | 29 1D ] GS (Group Separator) 61 3D = 93 5D ] 125 7D } 30 1E RS (Record Separator) 62 3E > 94 5E 126 7E ~

31 1F _ US (Unit Separator) 63 3F ? 95 5F _ 127 7F (Delete)

ASCI // Serial Port Crib Shet

ASCII_serial_port_crib_sheets.doc, © Copyright 2007 Tronisoft Limited. All Rights Reserved. 2

Pinout and Signals for the PC RS232 Connector DB9 RS232 Port (IBM PC XT/AT)

DB9 pin D-SUB male

Pin Signal Name Direction (DTE ← DCE) 1 CD (Carrier Detect) ← 2 RXD (Receive Data) ← 3 TXD (Transmit Data) → 4 DTR (Data Terminal Ready) → 5 GND (System Ground) - 6 DSR (Data Set Ready) ← 7 RTS (Request to Send) → 8 CTS (Clear to Send) ← 9 RI (Ring Indicator) ←

Note: a) Signal names are with respect to the computer/PC. b) Direction is from peripheral/modem (DCE) to the computer (DTE) e.g. RXD is the computer’s input pin.

Pin Signal NameDirection (DTE ← DCE)
1 SHIELD (Shield/Protective Ground)-
2 TXD (Transmit Data)
3 RXD (Receive Data)
4 RTS (Request to Send)
5 CTS (Clear to Send)
6 DSR (Data Set Ready)
7 GND (System Ground)-
8 CD (Carrier Detect)
9 n/c-
10 n/c-
1 n/c-
12 n/c-
13 n/c-
14 n/c-
15 n/c-
16 n/c-
17 n/c-
18 n/c-
19 n/c-
20 DTR (Data Terminal Ready)
21 n/c-
2 RI (Ring Indicator)
23 n/c-
24 n/c-
25 n/c-

DB25 pin D-SUB male

Note: a) Signal names are with respect to the computer/PC. b) Direction is from peripheral/modem (DCE) to the computer (DTE) e.g. RXD is the computer’s input pin. c) Do not connect SHIELD(1) to GND(7).

ASCI // Serial Port Crib Shet

ASCII_serial_port_crib_sheets.doc, © Copyright 2007 Tronisoft Limited. All Rights Reserved. 3

Decimal - Hexadecimal Conversion Chart

This chart shows the conversion between decimal and hexadecimal and vice versa.

0 1 2 3 4 5 6 7 8 9 A B C D E F 0 0 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 1 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 2 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047 3 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063 4 064 065 066 067 068 069 070 071 072 073 074 075 076 077 078 079 5 080 081 082 083 084 085 086 087 088 089 090 091 092 093 094 095 6 096 097 098 099 100 101 102 103 104 105 106 107 108 109 110 1 7 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 8 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 9 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 A 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 B 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 C 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 D 208 209 210 211 212 213 214 215 216 217 218 219 220 221 2 223 E 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 F 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255

Usage example: Hex 31 is equivalent to decimal 49. Alternatively decimal 255 is equivalent to hex F.

Comentários