At present we do not have a code example for PSoC 4 USB MIDI.
I think it is possible to create a similar project for PSoC 4 as the existing code example for PSoC 3 and 5LP. You need to make the following changes in the code example:
- Change the device for the code example to a PSoC 4L device
- The Sleep timer is not available for PSoC 4 device. There for You need to use other wakeup source in case of PSoC 4
- There is a difference in Clock and low power APIs that are being used in case of PSoC 4 and PSoC 3/5LP. For more details on this please refer to the PSoC 4 low power modes appnote: https://www.cypress.com/file/121271/download
Therefore you need to use the corresponding APIs for PSoC 4
- For USB you need to provide the following clock settings:
- Apart from this it would be required to assign correct pins to the in the Pins tab of the Design wide resources.
Have you looked into the project at this link:
Thanks for the tips.
I loaded the psoc 3/5 USB midi example project, adjusted the clock to 48MHz, and for now deleted the the sleep timer component and commented out the references to it in the source code.
The project now builds without errors but to get it to build I had to comment out the call to CYGlobalIntEnable. The program loads and runs, however no USB devices are enumerated on the host. I'm using the CY8CKIT-046 Pioneer Board.
Tracing it with the debugger I see that USB_IsConfigurationChanged() always returns false.
I suspect the problem is the commenting out of CYGlobalIntEnable. What is the equivalent for the psoc 4?
Attached is my workspace with the above changes to the CE95395 example project.
CE95395.cydsn.zip 5.6 MB
I have the answer to the question about CYGlobalIntEnable used in the example project being undefined on psoc4.
It seems that on psoc 4 the macro is called CyGlobalIntEnable (lower case 'y'), and on psoc 3 & 5 it's called CYGlobalIntEnable (upper case 'Y').
When is changed to use CyGlobalIntEnable, along with the other changes above, the project builds and the USB midi enumerates correctly.
The sleep timer is still not working. If we get it working correctly I'll post the complete ported project back here.