Hardware Reference
In-Depth Information
with your digital camera, and you want to send it via e-mail? This is where USB
On-The-Go (USB OTG) comes in.
USB On-The-Go is an extension to the USB specii cation, allowing devices
to act as either a master (host) or slave (peripheral). Technically, all USB OTG
devices are masters, but when connected to another master, they can act as a
slave. Some modern smartphones are USB OTG devices and act just like a normal
USB device; plug them into a computer and they become USB slaves, allowing
you to browse i les. However, plug in a USB peripheral, and they become a
master. A mobile phone can therefore be connected to a computer or to a USB
drive. Your phone can then browse i les on the USB key, just like a computer can.
USB Devices
There are far too many USB devices to list in a single book, and more and more
devices are made each day. Practically any type of computer add-on can be found
with a USB connection, from user input to screen output, from sampling graph-
ics to playing sound. Some devices are intelligent and can communicate with a
master, specifying their USB class and their capabilities. Some have no built-in
intelligence and simply use the +5-V power supply that the USB bus supplies;
this is often the case for some “gadget” USB devices; LED lights, fans, and so on.
Keyboards
A keyboard is one of the most useful components for any personal computer;
it is the primary means of entering textual information to a computer; it is a
human interface device.
Keyboards are, essentially, lots of electronic switches connected to a micro-
controller. It isn't possible to have one wire per key, so keyboards use a mesh
system. Essentially a giant game of battleships, a keypress causes two wires to
become active, and the microcontroller senses this information and translates
that into a scancode . It then sends this information to the computer.
A scancode corresponds to a key. The information is not sent in ASCII but in
binary information. It is not sent in ASCII for two main reasons: one, not every
letter can be sent as ASCII—function keys, for example. And two, a scancode
does not represent a letter. Let me explain.
While writing this topic, I am using a keyboard connected to my computer.
I press the letter A, and the letter A appears in my text editor. I have a French
keyboard which means the letters “Q” and “A” are swapped from an English
keyboard. My operating system translates what I type. So while my keyboard
has the letter “Q” written on it, as far as my computer is concerned (or even
the embedded microcontroller), it is an “A”. Anyone who has a non-English
 
Search WWH ::




Custom Search