PSoC™ 5, 3 & 1 Forum Discussions
Hello everbody,
i hope you can help me a little bit.
At the moment I am trying to program a PSoC 5 (CY8C5268LTI-LP030) with the CommandLineInterface.
Unfortunatey it isn´t working properly 😞
What have I done...
At the moment I am using this commands in a script:
OpenPort KitProg/0720063201324400 C:\Program Files (x86)\Cypress\Programmer
HEX_ReadFile "C:/HexFile/Testfile.hex"
SetAcquireMode "Reset"
SetProtocol 8
SetProtocolClock 152
SetProtocolConnector 0
SetPowerVoltage 5.0
//PowerOn
DAP_AcquireChip
PSoC3_EraseAll
PSoC3_ProgramRowFromHex 0x03 0 0
DAP_ReleaseChip
ClosePort
quit
Till the command "PSoC3_ProgramRowFromHex 0x03 0 0 " everything looks good. But while using this command I get following error message:
"PSoC3_ProgramRowFromHex 0x03 0 0
E
Timeout of SPC polling. Lost communication with chip (Status = 0x00)
PSoC3_ProgramRowFromHex 0x03 0 0 returned 80004005
80004005 OK"
And I am not sure how to fix it. I don´t know the problem... Is there anybody with an idea how to fix it?
Question 2:
Is there a command to program the whole hexfile without the rowId and arrayId? For example the command Program(). Unfortunately the UserGuid tells me it is only for PsoC1 😞
And is the arrayId 0x03 the correct id?
Many thanks in advance. I hope somebody can help me! 🙂
Ando some more informationen.
I am using a KitProg2 and the programming with PsocCreator oder PscoCProgrammer is working without any problems. So I guess there is no hardwareproblem.
I have CAN module in my design. All initialization code is generated by Creator. It generates a macro "CAN_BITRATE" which is used to initialize module, and value depends on user bitrate selection in GUI. But, I'd like to use bitrate stored in device database, instead of this compile-time constant. Is there any way to prevent Creator to generate CAN_init()-function? And define my own CAN_init(), of course containing the same stuff as in generated one, but using my own bitrate values.
Show LessHi,
We are using PSoC 5LP. In our workspace, there is one bootloader project and one bootloadable project, and they are linked together.
Before doing PSoC FW update, we need to call Bootloadable_Load() from bootloadable project to put PSoC into bootloader mode.
We found that, after setting PSoC to bootloader mode by calling Bootloadable_Load(), instead of a software reset, PSoC does a hardware reset. For software reset, Bootloadable_Load() makes PSoC stay in bootloader mode forever until there is a SW update; For hardware reset, it follows bootloader component settings ( "Wait for command") in bootloader project, wait for the time we set and boots into bootloadable application.
My questions are: how to make Bootloadable_Load() just do software reset so IO PSoC stay in bootloader mode?
I found something as below that may cause a software reset change to hardware reset, but not quite understand:
Note When the voltage detection is enabled and the configured threshold is below VDDA/VDDD during
the software reset (SRES), the hardware reset (LVI reset) might occur. During the software reset, the LVI
reset might get enabled (default state of the RESET_CR3 register) and hence the hardware reset might
occur instead of the software reset.
Best regards,
Winston
Show LessHi,
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 Less