LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high end application developer.
First we need to convert our ARM LPC 2148 processor into a HID device. To achieve this various changes have to be made in the USB Descriptor.
USB devices report their attributes using descriptors, which are data structures with a defined format. Each descriptor begins with a byte-wide field containing the total number of bytes in the descriptor followed by a byte-wide field identifying the descriptor type.
When an USB device is attached to the USB bus, the host uses a process known as bus enumeration to identify and configure the device. The USB Host sends setup requests as soon as the device has joined the USB network. The device will be instructed to select a configuration and an interface to match the needs of the application running on the USB Host. Once a configuration and an interface have been selected, the device must service the active endpoints to exchange data with the USB Host.
A Human Interface Device (HID) does not require any special USB driver, since the HID support is already built into Windows 2000 and Windows XP. Therefore HID devices can be directly connected to the computer.
The USB Device encodes the Morse code into a specific format and then maps it to its corresponding Key code.
For ex:- The Morse code for letter D is ' -.. ' . Most Morse characters only contain up to 5 marks (dashes or dots). We need 5 bits to represent such character. Inside the microcontroller eight bits are reserved for each character, so we have 3 unused bits. We used these to encode the length of each character. This makes the BInary Morse code data for letter D(0x61) = 0x 011 00001 .
The bits 5-7 are used to indicate the length of the Morse character: the binary 011 (decimal number 3). They indicate that our Morse character contains 3 marks: bits 0,1 and 2.