2013年10月15日 星期二

ASCII table

Src:
http://www.bluesock.org/~willg/dev/ascii.html

Notes:
NA

ASCII chart

For those like me who are lazy, this is an ascii listing I copied out of a book and dumped on a web-page for easy reference. Characters which appear as names in parentheses (e.g.(nl)) are non-printing characters.

end of line sequences
Windows end of line sequence:  \r\n
Unix end of line sequence: \n
Mac end of line sequence: \r


common ascii codes to know
Char  Dec  Oct  Hex   WhatAreThey
---------------------------------------
(nul)   0 0000 0x00   Null 
(ht)    9 0011 0x09   Horizontal Tab
(nl)   10 0012 0x0a   New Line
(vt)   11 0013 0x0b   Vertical Tab
(cr)   13 0015 0x0d   Carriage Return
(sp)   32 0040 0x20   Space
0      48 0060 0x30   zero
A      65 0101 0x41   capital A
a      97 0141 0x61   lowercase a


ascii table
Char  Dec  Oct  Hex | Char  Dec  Oct  Hex | Char  Dec  Oct  Hex | Char Dec  Oct   Hex
-------------------------------------------------------------------------------------
(nul)   0 0000 0x00 | (sp)   32 0040 0x20 | @      64 0100 0x40 | `      96 0140 0x60
(soh)   1 0001 0x01 | !      33 0041 0x21 | A      65 0101 0x41 | a      97 0141 0x61
(stx)   2 0002 0x02 | "      34 0042 0x22 | B      66 0102 0x42 | b      98 0142 0x62
(etx)   3 0003 0x03 | #      35 0043 0x23 | C      67 0103 0x43 | c      99 0143 0x63
(eot)   4 0004 0x04 | $      36 0044 0x24 | D      68 0104 0x44 | d     100 0144 0x64
(enq)   5 0005 0x05 | %      37 0045 0x25 | E      69 0105 0x45 | e     101 0145 0x65
(ack)   6 0006 0x06 | &      38 0046 0x26 | F      70 0106 0x46 | f     102 0146 0x66
(bel)   7 0007 0x07 | '      39 0047 0x27 | G      71 0107 0x47 | g     103 0147 0x67
(bs)    8 0010 0x08 | (      40 0050 0x28 | H      72 0110 0x48 | h     104 0150 0x68
(ht)    9 0011 0x09 | )      41 0051 0x29 | I      73 0111 0x49 | i     105 0151 0x69
(nl)   10 0012 0x0a | *      42 0052 0x2a | J      74 0112 0x4a | j     106 0152 0x6a
(vt)   11 0013 0x0b | +      43 0053 0x2b | K      75 0113 0x4b | k     107 0153 0x6b
(np)   12 0014 0x0c | ,      44 0054 0x2c | L      76 0114 0x4c | l     108 0154 0x6c
(cr)   13 0015 0x0d | -      45 0055 0x2d | M      77 0115 0x4d | m     109 0155 0x6d
(so)   14 0016 0x0e | .      46 0056 0x2e | N      78 0116 0x4e | n     110 0156 0x6e
(si)   15 0017 0x0f | /      47 0057 0x2f | O      79 0117 0x4f | o     111 0157 0x6f
(dle)  16 0020 0x10 | 0      48 0060 0x30 | P      80 0120 0x50 | p     112 0160 0x70
(dc1)  17 0021 0x11 | 1      49 0061 0x31 | Q      81 0121 0x51 | q     113 0161 0x71
(dc2)  18 0022 0x12 | 2      50 0062 0x32 | R      82 0122 0x52 | r     114 0162 0x72
(dc3)  19 0023 0x13 | 3      51 0063 0x33 | S      83 0123 0x53 | s     115 0163 0x73
(dc4)  20 0024 0x14 | 4      52 0064 0x34 | T      84 0124 0x54 | t     116 0164 0x74
(nak)  21 0025 0x15 | 5      53 0065 0x35 | U      85 0125 0x55 | u     117 0165 0x75
(syn)  22 0026 0x16 | 6      54 0066 0x36 | V      86 0126 0x56 | v     118 0166 0x76
(etb)  23 0027 0x17 | 7      55 0067 0x37 | W      87 0127 0x57 | w     119 0167 0x77
(can)  24 0030 0x18 | 8      56 0070 0x38 | X      88 0130 0x58 | x     120 0170 0x78
(em)   25 0031 0x19 | 9      57 0071 0x39 | Y      89 0131 0x59 | y     121 0171 0x79
(sub)  26 0032 0x1a | :      58 0072 0x3a | Z      90 0132 0x5a | z     122 0172 0x7a
(esc)  27 0033 0x1b | ;      59 0073 0x3b | [      91 0133 0x5b | {     123 0173 0x7b
(fs)   28 0034 0x1c | <      60 0074 0x3c | \      92 0134 0x5c | |     124 0174 0x7c
(gs)   29 0035 0x1d | =      61 0075 0x3d | ]      93 0135 0x5d | }     125 0175 0x7d
(rs)   30 0036 0x1e | >      62 0076 0x3e | ^      94 0136 0x5e | ~     126 0176 0x7e
(us)   31 0037 0x1f | ?      63 0077 0x3f | _      95 0137 0x5f | (del) 127 0177 0x7f



ascii codes and their escape sequences
ASCII Name   Description     C Escape Sequence
----------------------------------------------
nul          null byte       \0 (zero)
bel          bel character   \a
bs           backspace       \b
ht           horizontal tab  \t
np           formfeed        \f
nl           newline         \n
cr           carriage return \r




Back to my dev page.

2013年10月13日 星期日

ATA(SATA) protocol introduction


Src :
http://www.serialtek.com/sata_protocol_overview.asp (15'1/20 : NA)

Ref:
http://www.youtube.com/watch?feature=player_embedded&v=586wy4G0-1Q (SATA Introduction)
http://www.youtube.com/watch?feature=player_embedded&v=jFOmiLtYSLg (SATA Frame)

Book:

- The Essential Guide to Serial ATA and SATA Express (available in Google Ebook)

https://books.google.com.tw/books?id=PqvNBQAAQBAJ&printsec=frontcover&hl=zh-TW#v=onepage&q&f=false



Notes:

SATA's protocol :
- Link Layer - Primitives, out of Band (OOB) Signalling)
- Packet Layer - Frame Information Structures (FISes)
- Application/Command Layer - ATA Commands.


Link Layer:

- Primitives

Primitives are primarily used to start/stop/request data.
ALIGN – Sent to align activities between hosts and devices. Must be sent every 256 DWORDs
SYNC – Synchronize
X_RDY – Product is ready to start transmitting a frame
R_RDY – Product is ready to start receiving a frame
R_IP –  Product is receiving the frame
WTRM – Product has finished sending the frame and is waiting to terminate the connection
R_OK – Product has received the frame and it’s CRC is good
R_ERR – Product has received the frame and it’s CRC is bad
SOF – Start of Frame
EOF – End of Frame. DWORD previous to EOF is the CRC value
HOLD – Product not ready to send/receive additional data
HOLDA – Product acknowledges that other product needs time to “catch up”
CONT – “Continues” previous primitive until a different one is sent. Used to reduce EMI.
PMREQ_S – Interface Power Management Request for Slumber

PMREQ_P – Interface Power Management Request for Partial

PMACK – Power Management Request Acknowledged (approved)

PMNAK – Power Management Request Not Acknowledged (denied)

DMAT – Sent to terminate a DMA transmission

- Out Of Band Singaling (OOB) / Speed Negotiation

OOB, Out of Band, is a signaling pattern of either ALIGN primitives or DWORDs consisting of D24.3 characters and idle time used to initialize the SATA interface. There are three kinds of OOB signals used in SATA:
COMINIT – Used by the device to request a communication initialization
COMRESET – Used by the host to force a hardware reset on the device
COMWAKE – Used by either the host or device to signal the PHY layer to wake up.
Below is a diagram showing how speed negotiation is achieved.

speed_neg_diag.JPG
1.Host sends COMREST.
2.Device sees COMRESET, sends COMINIT
3.Host sees COMINIT, sends COMWAKE
4.Device sees COMWAKE, sends ALIGN primitives at highest supported speed
5.Host sends D10.2 at 1.5Gps as clock reference, sees ALIGNs and sends ALIGNs
6.Host and device send SYNC primitives



ultrahaptics


Reference:
http://tw.news.yahoo.com/%E8%B6%85%E8%A7%B8%E8%A6%BA-%E9%97%9C%E9%8D%B5%E5%A0%B1%E5%91%8A%E5%A0%B4%E6%99%AF%E6%88%90%E7%9C%9F-221028952.html

Notes:
 Cool! No need to touch small screen anymore and real feedback for interactive !


超觸覺 關鍵報告場景成真

〔國際新聞中心/綜合報導〕英國布里斯托大學團隊研發多年的「超觸覺(ultrahaptics)」技術,有如武俠小說描寫的「隔空取物」般神奇,只要凌空伸出手掌,即可操控在手掌相應位置外的螢幕,宛如湯姆克魯斯主演的好萊塢電影「關鍵報告(Minority Report)」的場景。更神奇的是,沒碰觸到螢幕的手掌,竟也能有觸碰到物體的觸感。
這種系統日前在「世界人機介面創新大會」上亮相。起初,布里斯托大學科學家是利用偵測障礙物的倒車雷達為原型,接著運用多個微小喇叭組成的陣列「超音波轉換器」,將超音波波束集中成多個觸碰點,在半空中製造出許許多多看不見的按鍵。接著,科學家設法讓超音波訊號穿透螢幕,再運用演算法,讓超音波陣列在不同觸碰點創造出不同的振動模式,使用者碰觸到一個點時,感應器會偵測他們的手部動作,讓他們無需碰觸螢幕,即可與螢幕互動。
觸碰反餽其實跟現在非常普遍的觸控式手機類似,但「超觸覺」在技術上是更大的突破,過去需要實際觸碰裝置來完成的動作,現在不用實際碰到裝置就能完成。團隊成員卡特表示,觸控螢幕讓使用者透過觸碰反餽來敲擊螢幕按鍵,「超觸覺」系統只要在空中揮揮手,即可達到控制效果。
「超觸覺」系統還可透過調整頻率,給予使用者不同的觸感,從低頻時猶如雨滴輕落在手中的觸感,到較高頻時像是泡沫掉落手心的感覺都有。透過互異的觸感,即可創造出「按」下「放映」鍵時,與「按」下「音量」鍵時感覺不同的效果。此外,透過2個並排的觸碰點,使用者甚至可以凌空做出捏取東西的動作,隔空抓取螢幕上的圖像。
科學家表示,這種技術還能透過調整頻率來改變凌空觸感,並可能有多種應用。例如開車時,駕駛人要是眼睛不想離開馬路,透過「超觸覺」無需盯著導航系統,也不用碰到螢幕,就能達到操控效果。科學家也正在研發使用觸碰反餽的地圖應用程式,手凌空放在地圖上的不同點,可感受到不同的振動頻率,例如把手掃過人口較稠密的地區,會感受到較強的振動頻率等。