PSoC-5 Applications & Implementation
PSoC-5 Applications & Implementation
ABSTRACT
The main objective of this paper is to make us understand the role of importance of PSoC-5in our lives and also to know about
its various applications. Here we are going to provide a complete report on the functionality and also the implementation of
various projects on Psoc-5. Our main application over which we will work on is ADC data buffering using DMA & USB Key
HID interfacing with Keyboard.In case of ADC data buffer we will see the data will buffer easily with less losses. Also we will
see how we can interface keyboard with USB HID. These are the widel applications on which we will work on. The need of
PSoC-5 in this era is incredible. The PSoC-5 has got time management skills which makes easy and error free research areas.
PSoC-5 helps systems to retain compatibility, flexibility and is also cost effective. So as to meet the demands of the fast growing
technology we need to learn the various aspects and functionality of the PSoC-5which will help to make our work and
knowledge more valuable. PSoC-5is used in wide no. of applications. It has got a lot of scope in the future as well in the
present. The applications are power management, wireless communication, automotive transportation, centre console, touch
screens, button replacement, HVAC, motor control, switches, ultrasonic parking, computer and peripherals like iPod, iPhone,
iPad accessories and thermal management. It has got a lot of scope in medical lines like making Blood Pressure monitor,
Blood glucose meter, fertility monitor and infusion pump. Our goal is to implement the applications ADC DATA
BUFFERING USING DMA and USB HID INTERFACING WITH KEYBOARD. For achieving our goal we are starting
here with small experiments. In case of ADC data buffering using DMA through PSoC-5 the data get buffer with less losses
and we get the result by the easiest way. In the other application we can interface the USB with Keyboard very easily.
1.INTRODUCTION
PSoC-5 microcontroller is plays a very widel role in many applications now a days. As for a project it covers all the
needs on a single chip.It gives a whole new concept of microcontroller as it contains both analog & digital
blocks.PSoC-5(Programmable system on chip) [9] is made by Cypress semiconductor & is to be defined as the family of
integrated circuits.
Here we are going to do study about the basic principle of Psoc-5, implementation of small projects which will
implemented in all the processor modules ie CY8C28, CY8C38 CY8C55.Further we will work on ADC data buffering
using DMA and USB HID intermediate with Keyboard as the big applications of Psoc-5.
We will work here on PSoC-5 Designer, PSoC-5 Creator, PSoC-5 Programmer for achieving the results & for further
analysing them.PSoC-5(Programmable System on Chip) represents a whole new concept in microcontroller
development. In addition to all the standard elements of 8-bit microcontrollers, PSoC-5chips feature digital and analog
programmable blocks, which themselves allow implementation of large number of peripherals.Digital blocks consist of
smaller programmable blocks that can be configured to allow different development options. Analog blocks are used for
development of analog elements, such as analog filters, comparators, instrumentational (non)inverting amplifiers, as
well as AD and DA convertors.Number of components that can be devised is primarily a function of the available
programmable blocks. Depending on the microcontroller family, PSoC-5chips have 416 digital blocks, and 312
analog programmable block
2.THEORY
We are focusing here on reading all the desired materials and the datasheet of Psoc-5. We will use the tools like PSoC5Creator and designer to run different programmes which are necessary to understand the functioning of both the tools.
Firstly we will simply blink the LEDs using the PWM [10] as peripheral on PSoC-5 Creator and Designer using the
development Kit. We will also repeat the project by taking different ports period and period width.
Secondly we will be implementing a project which demonstrates a 9-bit Delta Sigma ADC by measuring the voltage of
the potentiometer center tap wiper and displaying the result on the LCD on all the processor modules and all the
software.These all were the basic projects that we done for knowing the steps for performing the applications.These
basic projects that we done helps us for getting our main applications.
After doing all these minor projects we comes to know about the usage of the PSoC-5 we will directly focus on
achieving the applications of Psoc-5. In case of ADC data buffering using DMA. DMA [13] controller is uses to handle
Page 108
the data transfer without CPU intervention. DMA is useful in applications that require ADC data buffering and allows
the CPU for doing the simultaneous tasks. Here we will see the basics of 8-bit, 16-bit, and 20-bit Delta Sigma ADC
data buffering using DMA with example projects. The 20-bit example project accompanying this application note
demonstrates problems with data buffering using DMA. These problems occur when the peripheral spoke width is less
than the actual data width. The project describes how to tackle this using multiple DMA channels. The DMA is used to
move data from a source to destination without CPU intervention is the basic concept on which we will further work.In
our third application i.e. USB HID intermediate with Keyboard, We are using here Psoc-5 full speed USB interface,
where we will take the basics of USB HID development and its implementation is depends upon the knowledge by
which users get knows that how to incorporate the OUTPUT items to receive information from a host device using the
status LEDs on a keyboard taking as an example, we also send the keyboard information as an INPUT to type a
predefined string of text into a text editor.
3.METHODEOLOGY
Here we will covers the next level of Human Interface Devices (HID) [11] USB development on PSoC-53 / PSoC-55
discussing OUTPUT items using a keyboard. Weare using here Psoc-5's full speed USB interface, where we will take
the basics of USB HID development and its implementation is depends upon the knowledge by which users get
knowsthat how to incorporate the OUTPUT items to receive information from a host device using the status LEDs on a
keyboard taking as an example, we also send the keyboard information as an INPUT to type a predefined string of text
into a text editor.
Human Interface Devices (HID) [12]are the devices which enable the consumers to easily interface with and control
their PCs. almost all of the HIDs send information to the host. Keyboards and mice are the most common
examples.However, there is often PC have needs to send the information to the peripheral and for receiving the
information is from the host that is accomplished with an Output Report.
Output Items in the HID Report Descriptor must be configured properly for receiving this Output Report
properlyconfiguring the Output items.The transferring result can take the form of a LED on a keyboard.The Keyboard
requires the interaction from the host to provide the information to it. In a keyboard the Input has taken from the keys
that the user presses and Output taken from the LEDs on the keyboard by which the information will display (such as
checking if the caps lock is enabled or not).
For understanding the Output Items in greater detail, the Report Descriptor will uses for a 104-key keyboard. In Figure
3.1 it will shows HID Report Discriminator in which by expanding the parameters we will able to get output. The
chosen organization of the report descriptor follows the required format for a boot interface, which we are discussing in
the Boot Interface section. However, the report descriptor can be organized in various ways and still function as a
keyboard with LEDs.
Page 109
Bytes are sent to the host as an Input Item and one byte is received from the host as an Output Item. There are eight
bytes which are sent to the host and are firstly organized with modifier keys.They are followed by general keys which
are shown in Table 3.1A modifier key is uses which is a key and with the help of it the functions of a general key are to
be modifies for performing the alternative functions.Modifier keys on the keyboard include the shift, alt, and GUI keys.
All other remaining keys are considered as general keys. The format in which this information is transferred to the host
is shown in Table
Table3.1. (Keyboard Input Report Table)
There are only seven bytes of useful information when we sent information is of 8-byte packet. This is because of the
reserved byte (Byte 1) shown in Table 3.2 It is intended for OEM [14] use and is not used in most applications. There is
to be a reserved key that may be used on a keyboard which contains a non-standard key and performs a function that is
specific to that PC. We can see it in laptops and tablet computers.
In most of the keyboards that are purchased in the consumer market, the reserved byte remains a constant value of 0x00
and the remaining bytes in the configuration are the general keys. In a given transaction six available bytes of
information indicate that up to six key codes can be sent to the PC and it will enables up to six simultaneous key
presses. The order of the key codes in the array does not have any significance.When we compare the newly received
report from the previous report the sorting is accomplished then.
Table 3.2(Modifier Key Index)
In Table 3.2 We can see that each modifier key has a corresponding bit associated with it.It means in a bit field of
information the modifier keys are stored. The HID Usage Tables shows that the Usage values for the modifier keys are
in the range from E0-E7. However, it is also to be seen that the usage values are not sent as array data. The modifier
keys are to be sent as variable data and it means that each individual bit in the 8-bit value is corresponds to one of the
modifier keys. The Usage Minimum/Maximums are then used to link the modifier key information in the bit field to
the proper Usage value with the Usage Minimum/Maximum.
The difference between Array and Variable becomes more relevant in this keyboard application.We can differentiate
them as follows:
Array versus Variable: Array means only controls that are currently active are reported such as a button being pressed.
Variable means that the data reported is the current state of every control regardless if a button is pressed or not.
According to the USB HID Usage table, the usage values for the LEDs are provided in Table 3.3 LED information is an
Absolute Item, which means that the Output Report must include the state of each LED with 0 meaning off and 1
meaning on.The LEDs are not relative items, which means that a 0 represents no change and 1 represents a change
in state.
Table 3.3(LED Indicator Index)
Page 110
When referencing the Report Descriptor the first Input item is from top down and for the modifier keys (Shift, Alt, and
GUI). These keys are configured in a Variable configuration to implement a bit field. The Input Item configuration for
Keyboard modifier keys is shown in Figure 3.1
Page 111
The final Input Item to configure is for the general (non-modifier) keys. The HID specification requires these keys to be
configured with an Array and Absolute configuration.
It is a PC user desires to enter a PCs BIOS upon boot up to edit it. For getting this, the USB HID Specification defines
a boot protocol for keyboard. These protocols are predefined and the device is required to conform to the specifications
to be a boot device. The boot protocol supports up to eight bytes of information.BIOS can ignores anything over these
eight bytes[11]. It is a very important point that in actually BIOS does not read the report descriptor because of the
predefined standard, the BIOS have expectations of the information in a certain format. Because of this reason a HID
device such as a keyboard can have two interfaces.These interfaces are: one is the boot interfaces and the other is USB
aware interfaces. In first kind of interfaces i.e. the boot interface, the requirement of a hard coded Report Descriptor is
not necessary here.
This is the project which act as a keyboard and it will type the messages also will displays the status of num lock, caps
lock, and scroll lock.
Here we are going to introduce the user to a HID device and it consists of both an Input and Output transfer. The
project acts as a keyboard that types messages and displays.For getting our application we have to do following steps:
For this project, we will start by opening PSoC-5Creator and thus create an empty project named Project_1_Keyboard.
After the project has been created and PSoC-5Creator is completely loaded, we will place the following components
into the schematic entry page (TopDesigncysch).
Character LCD
(1) USBFS
(2) Digital Input Pins
(3) Digital Output Pins
Page 112
These pins required certain changing in settings.Thus for the Input Pins, we will open the pin configuration customizer
and be sure to uncheck the HW Connection box and thus changing their drive mode to Resistive Pull Down which is
done by clicking on the General tab in the pin customizer menu. For the Digital Output Pins, open the configuration
menu, uncheck the HW Connection box, and change their drive mode to Strong.
When the components are placed, we go to the Workspace Explorer window and thus double click on
MyFirstKeyboardHID.cydwr. Click on the Clocks tab and then double click on one of the clocks to open the GUI
clock configuration window.We will make the following changes to the clock as shown in Figure 3.7.
IMO 24 MHz
ILO 100 kHz
PLL Input: IMO, Desired: 48 MHz
Master Clock PLL Out
USB Clock IMO x2
Page 113
Our next step is to be the selection of Configuration Descriptor and the window changes as shown in Figure below.
Since the project is bus powered, limit the maximum current that can be supplied to the device. It is important to
specify a value that is appropriate for the device. Here we are using 20 mA which is more than sufficient.
Page 114
Page 115
We will use the jumper wires to make the following connections on the PSoC-5CY8CKIT-001. If we want to change
the pin configuration from Figure 4.31,we have to sure to change the wiring configuration accordingly.
SW1 -P0[6] -Caps Lock Key
SW2 -P0[7] -Type Constant String
LED2 -P1[5] -Num Lock LED
LED3 -P1[6] -Caps Lock LED
LED4 -P1[7] -Scroll Lock LED
LCD -P2[6:0] -Status Display
After the device is programmed, we will connect a USB cable from the PC to the DVK. When the device has
enumerated, we will press the Caps, Num, and Scroll Lock keys on our keyboard and then observe the changes on
LEDs and LCD accordingly. When we Press SW1 on the DVK and then observe the Caps Lock toggle. In next step we
will open a text editor on the PC and then press SW2. Observe a string of text transmitted to PC and displayed in the
text editor. We are free to edit the string in the main.cfile to type anything. The program by which we will able to
obtainour application is to be explain on Appendix.
4 RESULT ANALYSIS
In this chapter we have shown the simulation results obtained by us while working on different applications of the
Psoc-5.
ADC Data buffering using DMA
Build and program the chip
Press F5 or click the debug icon to download the program and debug.
Page 116
Page 117
5.APPLICATIONS
These all were the methodology by following the each and every steps from here we firstly implement the small projects
and further will implement our main big applications i.e ADC DATA BUFFERING USING DMA and third
application is USB HID intermediate with Keyboard.For getting these main applications implementations we will
follow the same method from these PSoC-5creator, PSoC-5designer and PSoC-5 Programmer but for these we will
firstly study what is data buffering, what is ADC data and what the meaning of DMA, how data will buffer by DMA?
In our next application i.e. USB HID intermediate with Keyboard, here we will see how we can intermediate the
keyboard with USB HID.We will provide the input from Keyboard by pressing any key on Keyboard like Caps Lock
and then output we will see on PSoC-5board by LED glowing. Hence we will comes to know that the USB HID get
intermediate with Keyboard. By knowing all these concepts and all these questions we will easily implement our
applications
6.CONCLUSION
This dissertation focuses on use of PSoC-5(Programmable System on Chip) for achieving big applications. We designed
here ADC data buffering using DMA and USB HID intermediate with Keyboard. In case of ADC data buffering using
DMA, we buffers 8 bit, 16 bit, 20 bit and 12 bit SAR ADC data using DMA very easily.USB HID intermediate with
Keyboard, we have done burning of the program on Pasco throughPSoC-5/ Miniprog 3 from PC to PSoC-5board and as
the output we can see the output on board in the form of light in LED by providing the input from Keyboard. PSoC-5is
a less time consuming device.
We started from basics projects .With the help of these basic projects we got enough information to achieve our main
applications. Firstly we have done LED with PWM project, thus we put some changes on it by changing the
connections and as a result we glow the LED on board. We also have done ADC to LCD display and other basic project
was Capsense. By doing these projects we got familiar with the working of cypress kit.
This Kit is very attractive and main thing that it is very interesting. On performing the work on kit, we felt more
curiosity for doing work on it. By the use of this kit we can also make our own IC.
REFRENCES
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
Page 118
[10] The Method of data exchange between high performance PWM modulator and MCU by Maxim, D. ; Volkov, A.G.
; Makarov, D.V. Micro/Nanotechnologies and Electron Devices (EDM), 2012 IEEE 13th International Conference
Publication Year: 2012.
[11] A human-robot interface using vision-based eye gaze estimation system Dong Hyun Yoo ; Jae Heon Kim ; Do
Hyung Kim ; Myung Jin Chung Intelligent Robots and Systems, 2002. IEEE/RSJ International ConferenceYear:
2002.
[12] Microcontroller implementation of a voice command recognition system for human-machine interface in embedded
systemsBernal-Ruiz, C. ; Garcia-Tapias, F.E. ; Martin-del-Brio, B. ; Bono-Nuez, A. ; Medrano-Marques, N.J
Emerging Technologies and Factory Automation, 2005. ETFA 2005. 10th IEEE Conference in 2005.
[13] DMA controller design using self-clocked methodology Aghdasi, F. ; Bhasin, A.AFRICON, 2004. 7th AFRICON
Conference in Africa, 2004.
[14]A Case Study to Track High Value Stillages using RFID for an Automobile OEM and its Supply Chain in the
Manufacturing IndustryAghdasi, F. ; Bhasin, A. AFRICON, 2004. 7th AFRICON Conference in Africa
Page 119