PSoC™ 5, 3 & 1 Forum Discussions
text.format{('custom.tabs.no.results')}
Hi,
My usecase requires PSoC controller as both I2C Master and I2C Slave and switch between those two seamlessly without reprogramming.
I2C Write from PSoC to EP - PSoC should be master here. Immediately after, EP should be able to control clock & become master and doI2C Write from EP to PSoC. What should be my design like in this case ? Do I need two separate I2C components - one for Master (I2C_1) and one for Slave(I2C_2) ? In that case, which I2C line will my EP have access to so will that work ? Or a single I2C component can be configured to be both I2C Master and Slave and switch between those two modes based on who sends START condition & controls the clock ? I'm new to embedded programming so any help and explanation would be really helpful. Thanks in Advance.
I need to use the same pin sometime as input and sometime as output in the same program.
How can I change the pin direction while program runs in a CY7C64315 chip ?
Show Less
I'm trying to have a PSOC5LP emulate a PS4 controller which has two INT endpoints (IN/OUT).
The IN is working (HID data successfully transfers) but the host device driver doesn't seem to see the OUT endpoint.
I've been using Wireshark (USBPcap) to compare a real PS4 controller vs using the PSOC5LP.
Endpoint config:
After enumeration:
The Code:
uint8 data_buffer[250];
uint16 length = 0;
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
UART_1_Start();
USBFS_1_Start(0u, USBFS_1_5V_OPERATION);
while(!USBFS_1_GetConfiguration()); // Wait until USB is configured
USBFS_1_EnableOutEP(3); // Enable output endpoint
USBFS_1_LoadInEP(4, HID_data, 64); // prime the USB buffer with usable data
Clock_1_Start();
isr_1_StartEx(Scan_Devices);
data_buffer[0] = 0;
for(;;)
{
// send data out to PC
if(USBFS_1_bGetEPAckState(4)) // wait for ack from PC
{
USBFS_1_LoadInEP(4, HID_data, 64); // send HID data to PC
// increment report count
report_count += 1;
if(report_count == 0x40) report_count = 0;
HID_data[7] = report_count << 2;
}
if(USBFS_1_GetEPState(3) == USBFS_1_OUT_BUFFER_FULL)
{
length = USBFS_1_GetEPCount(3); // Get the length of received data
USBFS_1_ReadOutEP(3, data_buffer, length); // Get the data
}
}
Show Less
Hello everybody,
does one of you know if I can use the Micro-USB on my CY8CKIT-059 while supplying it externally with 3.3V? I have heard about removing D2 to split up VTARG and VBUS to not shorten the supplies. Though I am afraid that the logic levels of DM and DP could still be a problem due to the USB-connector working with 5V and the controller with 3.3V.
In the user guide of CY8CKIT-059 in the section about the power supply system, only using the PCB-USB gets mentioned while being supplied externally. In this case it says that KitProg adjusts the logic levels accordingly. Does the CY8Y5888LTI-LP097 adjust the logic levels in my case aswell?
Thanks a lot in advance,
Tim
Show LessHello!!
I have a PsoC 5 project in which I use an ADC_SAR component.
Is it possible to modify the reference voltage value via software? I need it to be able to take two different values
Thanks in advance
I have a project based on the USB_FS example that has a HID descriptor that describes an input and a feature report. This is a HID compliant custom device.
There is support to send the input reports using EP1+, using USBFS_LoadInEP, but not to send the feature report, which should be sent on EP0. I did some searches on this that yielded results from 5 years or more back saying there is no way to do this, but it is being worked on.
So, what is the current state? Is there a way to do this? This seems like a fairly common usage of HID, so I'm surprised if it is not implemented.
Show LessI'm implementing a device that works with a pre-existing application that performs a set HID feature report to initiate an operation (allocate a resource id) and then a get HID feature report to retrieve the status and handle. I need some guidance on the best way to implement get/set feature reports on the PSoC5LP. I've read through the various application notes on implementing a USB HID device (AN57473, AN58726, AN82072 etc) but I haven't found much guidance on set/get HID feature reports. From web searches I found references to the USBFS_FindReport_Callback function and have tried experimenting with it but haven't found a good guide on the best practices.
I've implemented HID feature get reports in the FindReport callback function without difficulty. But for set reports - I see the reportType and reportId values are available in the FindReport callback, but the data for the report descriptor itself isn't populated in the USBFS_DEVICEx_CONFIGURATIONx_INTERFACEx_ALTERNATEx_HID_FEATURE_BUF_IDx buffers yet. I found that the USBFS code doesn't fill out those buffers until after the FindReport callback returns. The USBFS3.2 document says that the "main" application should monitor the completion status block to determine if the value in the buffers is valid or not before using it.
I added a flag in the FindReport callback to tell the main loop that a set feature report was seen. The main loop polls that flag and checks the status completion block to see if the report is valid before acting upon it. The issue is that the main loop does a lot of other work and that the get feature request for the status from the host can often come before the main loop gets to the point when it can check the flag and status control block to even process the initial set feature report.
I've experimented and found that I can implement a USBFS_EP_0_ISR_ExitCallback function and the USBFS_DEVICEx_CONFIGURATIONx_INTERFACEx_ALTERNATEx_HID_FEATURE_BUF_IDx buffers and status control blocks are set by that point and I can process the set feature request before the following get status request is encountered.
Is this a good solution to my problem, or are there better ways of implementing this? Are there any good resources or guidance on implementing get/set HID feature reports for the PSoC series?
Show LessHi,
I have a question (and I suspect the answer is yes) regarding the GPIO ports on the PSoC5LP.
I have a few serial (9600 Baud) signals passing through the PSoC that could potentially require re-routing through the PSoC onto different voltage domains. On one end the device is 3.3V and the other is 1.8V.
Will this all just "work" presuming I have the VDDIO levels for their pins set appropriately and level shift the signals between the inputs/outputs? Or should I perform level shifting externally?
Thanks!
Show LessHi,
I'm using a CY8CKIT-059 in combination with TeraTerm. One thing I can observe when downloading a new binary is that the KitProg UART gets a bunch of garbage and confuses TeraTerm, which needs to disconnect and connect again.
Interestingly, other tools behave different:
YAT: gets just a few characters including escape sequences
HTerm: same as YAT
PuTTY: can't see any garbage
Currently it looks like the effect pops up mostly if the application sends UART messages after reset by itself (e.g. without receiving a message first and then send an answer), but I've to verify that. I assume that when KitProg is resetting the device within a character transmission, the application might interpret it as some escape sequences or something like that. I also can see the effect at a much lower rate and much less garbage if the application doesn't send anything at startup, so even transmitting nothing is not the (full) solution.
Disconnecting and reconnecting is not a big issue, it's simply annoying if you've to do it everytime a binary is downloaded. Since also YAT and HTerm show at least 'some effect', I want to suggest that the KitProg firmware disables the UART while downloading a binary.
Regards
Hello Community,
I am trying to implement a control functionality for the LCD backlight in my application, where the backlight of the LCD needs to be switched OFF after an interval (~10sec) maybe using an interrupt, without affecting the program's execution.
The system consists of a PSOC5 LP, 16x2 LCD, a temperature sensor over ADC, and a pushbutton (or a 4x4 keypad - I know the method of detecting the keypress is different), which can act as a trigger.
I think the approach is to use the timer, and trigger it with a pushbutton (or 4x4 Keypad - preferred) to generate an interrupt after a period has elapsed and then turn off the LCD backlight, without halting the execution of the program completely (like printing the temperature value continuously even after backlight is OFF), which I think would be to use the One-Shot mode of the timer.
Using the One-Shot does help with triggering and turning the LCD backlight OFF only once, but no response after that. The main application is a MENU system, where the LCD would need to go OFF on different screens, so the timer needs to have a reset of the Period once the ISR is finished - to then be able to trigger again and so on.
I would like to get some help with this application and I am unable to comprehend on how to reset the timer for the above-mentioned application.
Attached is the firmware with One-Shot Timer and ADC.
Hope someone can help.
Regards,
Yash