USB midi Example for psoc4?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ChGr_681881
Level 1
Level 1
5 questions asked First reply posted First question asked

I'm new to psoc.  I need to develop a USB midi driver for my psoc based device .  I found a USB midi example for psoc 3 & 5 but not for 4.  Is there an example for psoc 4?

If  not, then I'll need to develop my own driver.  I'm porting a project from PIC32 for which I developed a custom USB MIDI driver a few years ago.

Can anyone suggest a suitable psoc4 USB example that I could use as a basis for converting to a USB midi driver?

How similar to the psoc4 would the USB midi code for the psoc 3/5 project be?  Similar enough to help me on the psoc4?

0 Likes
1 Solution

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.

View solution in original post

0 Likes
3 Replies
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello chgr_681881

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:

         pastedImage_1.png

      

  • 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:

https://www.element14.com/community/thread/24894/l/psoc-4-pioneer-kit-community-project033-sweet-mus...

Best Regards

Ekta

0 Likes
lock attach
Attachments are accessible only for community members.

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.

0 Likes

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.

0 Likes