Key Usb
![]() |
Designing USB Applications with PSoC
Design engineers have long been familiar with USB, first introduced in 1995 to replace the aging RS232 interface. It represents a simple, elegant means of communicating with as many as 126 connected devices using a well-defined protocol.
However, adding USB to an existing product is not necessarily simple or elegant, and adding it to new projects adds a degree of complexity that may now be largely avoidable.
Cypress Semiconductor’s CY8C24794-24LFXI is a member of its popular Programmable System-on-Chip (PSoC) family of mixed-signal arrays. The 24794 includes a full-speed (12 Mbps) USB 2.0 Serial-Interface Engine (SIE), including a 0.25 percent accurate clock with an integrated oscillator that meets USB 2.0 clocking specifications and requires no external crystal, reducing component and pin counts. The device offers PSoC designers a complete USB interface, essentially for free.
The CY8C24794 provides four unidirectional endpoints and one bi-directional control endpoint to support control, interrupt, isochronous, and bulk transfer types, as well as flexible synchronization. It offers up to 48 analog inputs, so no external analog multiplexer is required for applications such as laptop touchpads using CapSense technology. This article describes the new PSoC, its USB interface and applications that can be easily designed using the device.
Not Your Father’s SoC
The PSoC family of devices are designed to replace traditional MCUs, system ICs, and the numerous discrete components that surround them. This architecture allows the user to create customized peripheral configurations that match the requirements of each individual application. Additionally, a fast CPU, Flash program memory, SRAM data memory, and configurable I/O are included in a range of pin-outs and packages. The PSoC CY8C24794 is a unique member of the PSoC family because it includes a full-featured, full-speed (12 Mbps) USB port.
The PSoC architecture (Figure 1) consists of four main areas: PSoC Core, Digital System, Analog System, and System Resources including a full-speed USB port. Configurable global busing allows all the device resources to be combined into a complete custom system. The PSoC CY8C24794 device can have up to seven I/O ports that connect to the global digital and analog interconnects, providing access to four digital blocks and six analog blocks.
The PSoC core consists of a 24-MHz, 4-MIPS Harvard-architecture CISC CPU with 16-Kbits of Flash for program storage, 1-Kbit of SRAM for data storage and up to 2Kbits of EEPROM emulated using the Flash. Program Flash utilizes four protection levels on blocks of 64 bytes, allowing customized software IP protection. The PSoC device incorporates flexible internal clock generators, including a 24 MHz internal main oscillator (IMO) accurate to 8% over temperature and voltage. The 24 MHz IMO can also be doubled to 48 MHz for use by the digital system. A low power 32 kHz internal low-speed oscillator (ILO) is provided for the Sleep timer and watchdog timer (WDT).
PSoC GPIOs provide connection to the CPU, digital and analog resources of the device. Each pin’s drive mode may beselected from eight options, allowing great flexibility in external interfacing. Every pin also has the capability to generate a system interrupt on high level, low level, and change from last read.
The Digital System (Figure 2) is composed of four digital PSoC blocks. Each block is an 8-bit resource that can be used alone or combined with other blocks to form 8, 16, 24, and 32-bit peripherals. The digital blocks can be connected to any GPIO through a series of global buses that can route any signal to any pin. The buses also allow for signal multiplexing and for performing logic operations. This configurability frees designs from the constraints of a fixed peripheral controller.
The Analog System (Figure 3) consists of six configurable blocks, each comprised of an op amp circuit allowing the creation of complex analog signal flows. Analog peripherals are very flexible and can be customized to support specific application requirements. Analog blocks are arranged in a column of three, which includes one Continuous Time (CT) and two Switched Capacitor (SC) blocks.
The CY8C21x34 and CY8C24x94 PSoC devices differ from the other PSoC devices in that GPIO pins can connect to the internal analog bus. The CY8C24x94 contains the additional capability to optionally split the analog bus into two separate sections. In the CY8C21x34 all GPIO pins are enabled for this connection. In the CY8C24x94 all pins in Ports 0 through 5 are enabled for connection to the analog Bus.
System Resources provide additional capability useful to complete systems. Additional resources include a multiplier, decimator, low voltage detection, and power on reset.
PSoC USB
The PSoC USB system resource adheres to the USB 2.0 specifications for full-speed devices operating at 12 Mb/second with one upstream port and one USB address. PSoC USB (Figure 4) consists of a Serial Interface Engine (SIE) block; a PSoC Memory Arbiter (PMA) block; 256 bytes of dedicated SRAM; a Full-Speed USB Transceiver with internal regulator; and two dedicated USB pins.
At the system level, the full-speed USB system resource interfaces to the rest of the PSoC by way of the M8C's register access instructions and to the outside world by way of the two USB pins.
The SIE supports five endpoints including a control endpoint (endpoint 0) and four data endpoints (endpoint 1, 2, 3, and 4). The control endpoint can be configured to support SETUP, IN, and OUT requests. The data endpoints can be individually configured to respond to Interrupt, Bulk, or Isochronous IN or OUT requests.
The USB Serial Interface Engine (SIE) allows the PSoC device to communicate with the USB host at full-speed data rates. The SIE simplifies the interface to USB traffic by automatically handling the following USB processing tasks without firmware intervention:
• Translating the encoded received data and format the data to be transmitted on the bus.
• CRC Checking and Generation. Incoming packets failing checksum verification are ignored.
• Address Checking. Ignores all transactions not addressed to the device.
• Sending appropriate ACK/NAK/Stall handshakes.
• Identifying token type (SETUP, IN, OUT) and setting the appropriate token bit once a valid token in received.
• Identifying Start-of-Frame (SOF) and saving the frame count.
• Sending data to or retrieving data from the USB SRAM, by way of the PSoC Memory Arbiter.
Firmware is required to handle various parts of the USB interface. The SIE issues interrupts after key USB events to direct firmware to appropriate tasks: fill and empty the USB data buffers in USB SRAM; enable PMA channels appropriately; coordinate enumeration by decoding USB device requests; suspend and resume coordination; verify and select data toggle values.
The PSoC USB System Resource contains a dedicated 256 byte SRAM. This SRAM is identical to an SRAM page used in the PSoC Core; however, it is not accessible by way of the M8C memory access instructions. The PSoC USB's dedicated SRAM may only be accessed by way of the PMA registers.
The PSoC Memory Arbiter (PMA) is the interface between the PSoC USB's dedicated SRAM and the two blocks that access the SRAM: the M8C and the USB SIE. The PMA provides eight channels to manage data. All of the channel registers may be used by the M8C, but the four non-control USB endpoints are each allocated to a specific set of PMA channel registers. The internal USB transceiver interfaces to the external USB bus to transmit and receive signals according to the USB 2.0
Specification. In normal USB operation, the transceiver interfaces directly to the SIE and no user interaction is needed after initialization.
Connecting to an external USB device is simple, requiring only the addition of two resistors. Figure 5 shows a sample schematic for USB with the 56-pin MLF PSoC device (CY8C24794).
The CY8C24794-24LFXI includes Cypress’ CapSenseTM technology, which offers an efficient solution to replace mechanical switches and controls with simple, touch-sensitive controls. The PSoC architecture makes it easy to connect touch-sensitive controls to LED drivers, LCD displays and other peripherals.
In its basic form, a capacitive switch is a pair of adjacent plates, as shown in Figure 6a. There is a small edge-to-edge capacitance, but the intent of switch layout is to minimize the capacitance between these plates. When a conductive object is placed in proximity to the two plates, as shown in Figure 6b, there is a capacitance between one electrode and the conductive object and a similar capacitance between the conductive object and the other electrode.
The most common form of capacitance switch array is a set of capacitors where one side of each is grounded. Thus, the active capacitor has only one accessible side; the switch is a grounded variable capacitor. The presence of the conductive object increases the capacitance of the switch to ground. Determining switch activation is then a matter of measuring change in the capacitance.
The CY8C21x34 family has unique features that enable efficient designs for capacitive switch scan applications. The features include wide multiplexer array so that all channels being measured can be serviced by a common comparator and current source; a DAC adjustable current source; and automatic connection of comparator and reset switch.
This drive and multiplex arrangement bypasses the existing GPIO to connect the selected pin to an internal Analog Mux Bus, as shown in Figure 7. The capacitor charging current (IDAC, controlled by register DAC_D) and reset switch are connected to the Analog Mux Bus. This limits the pin-count requirement to simply the number of switches to be addressed; no external resistors or capacitors are required to enable operation.
The basic circuit and firmware of the PSoC CapSense solution are relatively simple, the physical design of the switchoperating environment is less so. There are three major categories for consideration when designing with capacitive sensing: the printed circuit board (PCB), the overlay material, and other elements not related to the PCB or capacitive sensing. Cypress has a series of application notes that cover these areas in more detail than we can manage here.
Example: Buttons and Lights
The CY8C24794 is supported by PSoC DesignerTM software, an evaluation board, ICE-Cube in-circuit emulator and miniprogrammer, all of which make it easy to experiment with new designs. The basic USB-based design described here lets you press a button on your target host PC and light up lights on the evaluation board. With all USB designs you are always dealing with two programs: one in the host and one in the remote device. A USB device does not actually ‘send’, it prepares data that the USB host will come and collect; the host controls all communications and a device only ‘talks’ when the host permits it.
The flow chart in Figure 8 shows the logical operation of the programs in both the device and the host in our example:
The USB_Start() call initiates the enumeration sequence that is handled by the USB User Module libraries; once enumeration is completed, we then post a buffer to receive a lights report from the PC. We then wait for an SOF flag to be set. The SOF_ISR sets this flag every 1 msec.
Once the SOF flag is set, we call scan-buttons(), which is a button de-bouncing routine. If we detect a button change, then we send a buttons report to the PC. We then check to see if a lights report was received in the previous frame; and, if so, we update the local LEDs. Note that from main()’s perspective, data is moved into and out of endpoint buffers; USB communications are handled in the background by the SIE. The USB run-time operation is as simple as reading and writing endpoint buffers.
For more information log on to http://www.cypress.com/?rID=3564
About the Author
Jon Pearson, is the Product Marketing Director at Cypress Semiconductor Corp.
|
|
Papershow, Papershow Usb Key, $66.99 PAPERSHOW, PAPERSHOW USB KEY, |
|
|
Vienna Instruments Vienna Key USB License Key $39 Vienna Instruments Vienna Key USB License Key |
|
|
Vienna Instruments Vienna Key Usb License Key $39 Vienna Instruments Vienna Key USB License Key |
|
|
Axiom 32GB USB 2.0 USB KEY USBFD232GBAXP $45.02 Axiom 32GB USB 2.0 USB KEY USBFD232GBAXP |
|
|
KEY Pro Foldable USB Keyboard $19.42 KEY Pro Foldable USB Keyboard |
|
|
Atdec USB - 104 Key TAAK10B $27.96 Atdec USB - 104 Key TAAK10B |
|
|
Solidtek / SG-KEY USB SECURITY LOCKING KEY / SG-KEY $33.92 Solidtek - SG-KEY USB SECURITY LOCKING KEY - SG-KEY |
|
|
ADESSO / 22KEY PS2 USB MECHANICAL KEY / AKP-220B $43.77 ADESSO - 22KEY PS2 USB MECHANICAL KEY - AKP-220B |
|
|
Epson / QUICK CONNECT WIRELESS USB KEY / V12H005M08 $107.12 Epson - QUICK CONNECT WIRELESS USB KEY - V12H005M08 |
|
|
IBM / USB MEMORY KEY FOR VMWARE ESXI / 41Y8296 $89.88 IBM - USB MEMORY KEY FOR VMWARE ESXI - 41Y8296 |
|
|
Grandtec Privekey USB Security Key PVK1000 $25.77 Grandtec Privekey USB Security Key PVK1000 |
|
|
Key Ovation USB - 22 Keys - Black GTCMACB $60.76 Key Ovation USB - 22 Keys - Black GTCMACB |
|
|
Kensington USB, PS/2 - 104 Key - PC 64338B $29.45 Kensington USB, PS/2 - 104 Key - PC 64338B |
|
|
ADESSO USB - 22 x Key AKP220B $39.59 ADESSO USB - 22 x Key AKP220B |
|
|
Seal Shield USB - 106 Key - PC SW106G2 $95.94 Seal Shield USB - 106 Key - PC SW106G2 |
|
|
Targus USB - 104 Key - PC AKB30USZ $31.28 Targus USB - 104 Key - PC AKB30USZ |
|
|
Micro Innovations USB - 110 Key - PC 4250400 $18.97 Micro Innovations USB - 110 Key - PC 4250400 |
|
|
Acer USB - 105 Key - French (Canada) KBKUS03230 $12.35 Acer USB - 105 Key - French (Canada) KBKUS03230 |
|
|
StarTech.com USB - 104 Key - English (US) CABUSKEYBD $60.81 StarTech.com USB - 104 Key - English (US) CABUSKEYBD |
|
|
Adesso PS/2, USB - 104 Key MKB125B $72.85 Adesso PS/2, USB - 104 Key MKB125B |
|
|
Imicro KB- IMG310 USB Chocolate Key Keyboard $13.74 Imicro KB- IMG310 USB Chocolate Key Keyboard |
|
|
Usb Memory Key F/ Vmware Esxi 4.1 $80.99 USB MEMORY KEY F/ VMWARE ESXI 4.1 |
|
|
Cisco USB Etoken USB Security Key 64MB MEMUSB64FT= $143.6 Cisco USB Etoken USB Security Key 64MB MEMUSB64FT= |
|
|
4GB/8GB/16GB usb flash drive key shape usb key flash drive $12.42 1. 4GB/8GB/16GB usb flash drive key shape usb key flash drive 2. Brand new and high quality 3. Long life time and durable to u |
|
|
USB Key 4 Port USB 2.0 Hub $4.99 SpecificationType: Flash Drive USB Ports: 4 Features: Portable USB Type: USB 2.0 Design: Professional Color: Black Compatibility: Windows 98SE/XP/ME/2000/Vista/7/Mac OS Dimensions (cm): 9.1x2.4x0.4 Weight (kg): 0.035Package Contents1 x USB key 4-port USB 2.0 hub |
|
|
Master Key USB Key - imm Living $33 Master Key USB Key- imm Living Much more than just a lock opener, keys are a basic feature of modern living around the world. In computing a key is a piece of information used in authentication codes. The USB Key accesses information, much like the familiar household key allows entrance to our home, car or office. The USB Key assumes the form of the common key. Attach it to your key chain for everyday use. Size:1.3" x 2.8" x 0.07" Material: PP Description:2 GB USB 2.0 1 Year limited warranty Drawing from the traditional and popular cultures of our world, imm Living creates designs marrying functionality with a playful sensibility. As varied as the people behind each project, their work is injected with rich meaning, evoking emotion between objects and people, while bridging cultural differences. |
|
|
Epson ELP AP08 - Wireless USB Key. Each $99.26 Manufacturer: Epson. Each. Product Type: Wireless USB key Customers also search for: Discount Epson ELP AP08 - Wireless USB Key, Buy Epson ELP AP08 - Wireless USB Key, Wholesale Epson ELP AP08 - Wireless USB Key, 010343880566, V12H005M08, Projector Cases |
|
|
Epson America V12H005M08 Wireless USB Connection Key $133.89 Wireless USB Connection Key (PowerLite 1760W 1770W 1775W) |
|
|
ELP AP08 - wireless USB key $91.99 Epson ELPAP08 - Wireless USB key - for EB 17XX PowerLite 17XX Pro G5450 Pro G5550 Pro G5750 Pro G5950 |
|
|
Promotional Gift, Waterproof Key USB Flash Drive ,USB Flash Memory Disk ,Pen Drive,Free Shipping $12.32 usb flash disk Promotional Gift, Key USB Flash Drive |
|
|
100% full capacity 8GB key shape USB Flash Drive $92 key shape usb,key drive 2.0,key usb flash High quality Fashion Design |
|
|
IBM USB Memory Key for VMware ESXi 4 $67.99 1 Server 41Y8278 Complete Product IBM IBM Corporation Not Applicable Software Standard USB Memory Key USB Memory Key for VMware ESXi 4 Utility VMware ESXi 4 www.ibm.com |
|
|
4GB/8GB/16GB usb flash drive key shape usb flash memory $10.53 1. 4GB/8GB/16GB usb flash drive key usb flash memory 2. Brand new and high quality 3. Long life time and durable to use |
|
|
4GB/8GB/16GB usb flash drive key shape usb stick $20.42 1. 4GB/8GB/16GB usb flash drive key usb stick 2. Brand new and high quality 3. Long life time and durable to use |
|
|
2MB USB KEY LOGGER $150 Features: Plug and Play installation- start recording in a flash 2Mb memory allows up to six months keystroke-recording under normal use Time and date stamping for legal use Device can be unplugged for keystroke retrieval on another computer Compact and discreet device does not use any system resources Windows and Linux compatible The Keystroke Logger USB will not interfere with any program running on the target computer and cannot be detected by any software. The Keystroke Logger is designed to blend in with the rest of the computer's hardware and cables and is virtually undetectable to the untrained eye. The USB Keystroke logger has an advantage over software keystroke loggers as it can begin recording keystrokes from the moment a computer is turned on giving it the ability to intercept passwords. The Keystroke logger interprets the information flow between your keyboard and computer, processes it, and passes it to the USB flash memory, which stores keystroke records and retains this information even when power is lost. The USB logger's 2Mb on-board memory can be accessed via a password protected menu system that will pull up keystroke recordings, allowing you to carefully review your target's activities. The Benefits: Know what your child is doing on the Internet Observe chat or E-mail messages sent by target user Protect your child or teen from dangerous e-Predators Detect unauthorized activity- is someone accessing your personal files? Monitor Internet, E-mail and chat room use by your child, spouse or employee Know what your employees are doing during business hours; are they working hard or hardly working? Includes: 2Mb Keystroke Logger USB Dimensions: 1.4" (37mm) x 0.5" (14mm) x 0.75" (19mm) |
|
|
Ruler USB Key- imm Living $33 Ruler USB Key- imm Living Tools are indicators of advanced culture. They are an extension of our human capabilities and an essential part of many occupations. The Ruler USB combines the earliest instrument for measurements with the latest computer accessory. Like some of our other USB designs, this product also acts as a sleek bookmark. Size:3.5" x 4.25" x 7.75" Material:PP Description:2 GB USB Key 2.0 1 Year limited warranty Drawing from the traditional and popular cultures of our world, imm Living creates designs marrying functionality with a playful sensibility. As varied as the people behind each project, their work is injected with rich meaning, evoking emotion between objects and people, while bridging cultural differences. |



US $6.50






















































































