PSoC™ 5, 3 & 1 Forum Discussions
Hi all,
For my current project, I require to be able to read the pulse width of a PWM signal and store it in a variable using a PSoC 5LP. I would appreciate the help if anyone offered me any method on how to do this efficiently.
Thanks
Show LessDear Mdm/Sir,
I was intending to Configure CY8C24894 as some generic data transfer between PC & this chip.
I try to configure USBFS as some HID device, with input/output report of 8 bytes each. The generated report descriptor is shown below.
USBFS_1_HID_REPORT_1_DESCR_START: ;
DB 06H, 00H, FFH ; Usage Page
DB 09H, 01H ; Usage
DB A1H, 01H ; Collection
DB 19H, 01H ; Usage Minimum
DB 29H, 08H ; Usage Maximum
DB 15H, 00H ; Logical Minimum
DB 25H, FFH ; Logical Maximum
DB 75H, 08H ; Report Size
DB 95H, 08H ; Report Count
DB 91H, 02H ; Output
DB 19H, 01H ; Usage Minimum
DB 29H, 08H ; Usage Maximum
DB 15H, 00H ; Logical Minimum
DB 25H, FFH ; Logical Maximum
DB 75H, 08H ; Report Size
DB 95H, 08H ; Report Count
DB 81H, 02H ; Input
DB C0H ; End Collection
USBFS_1_HID_REPORT_1_DESCR_END: ;
The simple firmware code is below
USBFS_1_Start(0, USB_5V_OPERATION);
while (USBFS_1_bGetConfiguration()==0x0); // Wait until it is configured.
USBFS_1_EnableOutEP(OUT_EP);
USBFS_1_LoadInEP(IN_EP, in_data_buf, NUM_BYTES, USB_TOGGLE); // Load & Enable
OFF_LED1;
OFF_LED2;
while (1)
{
ON_LED1;
if(USBFS_1_bGetEPAckState(OUT_EP))
{
ON_LED2;
USBFS_1_bReadOutEP(OUT_EP, out_data_buf, NUM_BYTES);
USBFS_1_LoadInEP(IN_EP, in_data_buf, NUM_BYTES, USB_TOGGLE); // Load & Enable
USBFS_1_EnableOutEP(OUT_EP);
}
}
I only see LED1 is on, but LED2 is always off.
I am using the CyUSB.dll to do the report data sending.curHidDev.SetOutput(curHidReport.ID);
The returned value tells me the sending is correct.
Can you please help me where I am wrong?
Thanks & Regards,
Chao
Show LessHi,
I have CY3295-MTK manufacturing test kit. I have CYTMA568-56LQI44BB Touch device. Simply I just want to tune my device with the manufacturing test kit. I have Touch Tuning Host Emulator Software to do the tuning job. The Touch Tuning Host Emulator shows my manufacturing kit as "connected" on the left bottom corner of software, but slave address and I2C clock shows "No Device". I am using I2C interface to communicate. I have used pull-up resistor for SDA and SCL lines. Pull-ups are connected to VCOM pin, and VCOM is adjusted to 2,6V. CYTMA568 device is powered with VAUX and it is 3.3V. Both Touch Tuning Host Emulator and Bridge Control Panel programs don't recognize the touchscreen. How to connect properly the touchscreen and get MTK kit recognize the touchscreen? I have checked both SCL and SDA lines with osciloscope, seems working, but still not recognized by PC.
Show LessHi,
I use FreeSoC2 Development Board, SparkFun’s take on the PSoC5LP ARM Cortex with two processors onboard: a CY8C5868LTI-LP039 and a CY8C5888AXI-LP096. I want configure USB Full-Speed (USBFS) component as HID Uninterruptable Power Supply Interface (UPS).
I have attached a simply project where i have configure hid descriptor in following mode :
<?xml version="1.0" encoding="utf-16"?>
<HID_Report xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Report_Name="Batteria UPS Test">
<Items>
<HID_Item Type="USAGE_PAGE" Code="4" Size="1" Value="132" Desc="(Power Device)" />
<HID_Item Type="USAGE" Code="8" Size="1" Value="4" Desc="(UPS)" />
<HID_Item Type="COLLECTION" Code="160" Size="1" Value="1" Desc="(Application)" />
<HID_Item Type="USAGE" Code="8" Size="1" Value="31" Desc="(FlowID)" />
<HID_Item Type="COLLECTION" Code="160" Size="1" Value="0" Desc="(Physical)" />
<HID_Item Type="REPORT_ID" Code="132" Size="1" Value="1" Desc="(1)" />
<HID_Item Type="USAGE" Code="8" Size="1" Value="53" Desc="(PercentLoad)" />
<HID_Item Type="USAGE_PAGE" Code="4" Size="1" Value="132" Desc="(Power Device)" />
<HID_Item Type="REPORT_SIZE" Code="116" Size="1" Value="8" Desc="(8)" />
<HID_Item Type="REPORT_COUNT" Code="148" Size="1" Value="3" Desc="(3)" />
<HID_Item Type="LOGICAL_MINIMUM" Code="20" Size="1" Value="0" Desc="(0)" />
<HID_Item Type="LOGICAL_MAXIMUM" Code="36" Size="2" Value="255" Desc="(255)" />
<HID_Item Type="INPUT" Code="128" Size="1" Value="0" Desc="()" />
<HID_Item Type="END_COLLECTION" Code="192" Size="0" Value="0" Desc="" />
<HID_Item Type="END_COLLECTION" Code="192" Size="0" Value="0" Desc="" />
</Items>
</HID_Report>
But when i read the report with Usb control center Cypress's tool i read all zeros. In the firmware i load and enable the specified USB data endpoint for an IN data transfer, in particular i want to send a specifical Percent Load. But it doesn't work. Why?
Thanks in advance for any replies.
Lucia
Show LessHi all,
I have a question about my USB HID Keyboard I'm running off a PSoC5LP [CY8C5468AXI-LP106].
End goal is I want to have the keyboard support keys beyond the standard 101. From a code perspective this is no problem, just load the keycode I want into the Endpoint and send it out to the host, but where I'm running into hang-ups is figuring out if my HID Descriptor is appropriate for what I'm trying to do. My current descriptor is as follows (based off the standard Keyboard w/ LEDs descriptor provided with PSoC Creator):
Now when I look at this, the values that stand out are:
LOGICAL_MINIMUM(0) 15 00
LOGICAL_MAXIMUM(101) 25 65
and
USAGE_MINIMUM(0) 19 00
USAGE_MAXIMUM(101) 29 65
My thought was I could just change these values, and that would tell the OS to expect key codes from this device beyond the standard 101, letting me use codes for keys like F13 - F24 and other various HID Keyboard codes >0x65:
LOGICAL_MINIMUM(0) 15 00
LOGICAL_MAXIMUM(221) 25 DD 00
and
USAGE_MINIMUM(0) 19 00
USAGE_MAXIMUM(221) 29 DD 00
This leaves me with:
Unfortunately this change doesn't seem to do anything on the Host PC Side (Windows 7 x64). The OS still does not appear to process any codes beyond 0x65. I'm unsure as to where the problem lies, in my Windows Host PC, or if I'm not setting up the Descriptor correctly.
Would anyone with some USB HID chops be able to shed a little light on the subject (or at least tell me if the descriptor is OK)?
Thanks in advance for the help!
Show LessI'm trying to mux together the 4 outputs of a UDB PWM on a PSoC5LP, and I could've sworn there was a way to do it with a single component. But the digital mux is only a switch; it won't let you mix multiple inputs. The analog mux component can be configured to mix or switch, but I'm not using analog signals, so that won't work.
I tried just connecting the PWM outputs together, but it gives me a "multiple drivers on one signal" error.
I suppose I could use a bunch of OR gates, but is there a single component that can do what I need?
Show LessHi all,
I am generating sine wave of 4kHz using external DAC124s085 spi interface with CY8CKIT-059 PSoC® 5LP Prototyping Kit . I am sending different data in decimal or hex that convert in sine wave.I am new in spi interface and new in these kit. I don't have much idea about schematic and how to write data in code? Can any one help me out that how can i write look up table?
Show LessHi All,
I am currently trying to implement a HC-SR04 ultrasonic distance sensor with a PSoC 5LP. I understand that I am supposed to determine the pulse width of the Echo signal, however I just cannot seem to understand how to do this in a PSoC 5LP.
I see many designs that use a counter and an ISR but do not say much as of where the information is stored.
Thanks
Show LessHello and sunny greetings from Germany :-)!
Now to the sunny part. I'm working on a voltage drop measurement in a photovoltaic circuit. My 10 laboratory cells deliver a voltage Voc = 5V and an Isc = 100mA. With a shunt resistor Rsh = 60 ohms, a resistor Rv = 100 ohms and a LED Uled = 2.5V I have a voltage range at the shunt resistor 0 mV < Ush < 927.6 mV. Over an output I let in addition the calculated current spend (max 15.45 mA).
The following problem exists:
1. When reading the voltage at the shunt resistor I can observe when outputting that the AD converter reaches a maximum and overflows.
2. The AD converter operates with an input range +/- 1.024V (-Input +/- Vref) and the reference voltage internally with 1.024V
3. As an example, I have attached the picture below.
Here it can be seen that the voltage drop rises up to approx. 61 mV (= 1mA), then overflows and the values are counted up again starting from 0 mV. So I can not read my stream exactly.
4. When changing the input range and reference voltage, only the time of overflow can be shifted.
Example: With the setting Input Range +/- 6.144 (-Input +/- 6 * Vref) and the reference voltage internally with 1.024 V receive an overflow will occur at about 0.360mV (= 6mA).
I hope you can help me.
Have a nice day
jg.vs
Hello everybody,
First, I wanted to say that I am new here and therefore I do not know if I have placed the topic in the right place (may then be moved by the admin).
So I'm not only new here in the community, but also freshly come into contact with the PSoC 5LP.
Nonetheless, I've ventured into programming with tutorials and Cypress test codes.
Now to the project:
I have a laboratory photovoltaic string consisting of 10 modules and 10 bypass diodes (U_oc = 5V and I_sc = 100mA). In the circuit there is a shunt resistor with 0.006 ohms and a consumer with 100 ohms and downstream green LED. About the voltage drop at the shunt I would like to calculate the current. I would like to have the issue displayed on HTerm.
The program and the output works. Unfortunately, the values given give me problems.
The attached picture shows my output in the red box without pin assignment, here should normally stand for both 0mV. And in the green box, the values that the measurement gives me, but the program does not jump to the output of Ush2.
Even if I do not use the lab string, but VDD and GND from the PSoC, then a current of about 25mA should flow. Accordingly, I should have a voltage drop of about 0.15mV. Since the voltage drop is very low, since my resolution is not right?
Actually, it is a simple voltage drop measurement, but I can not explain how the output values come about.
I hope you can help me.
Thank you very much and sunny greetings from germany
jg.vs