Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 5 > Use Visual Basic (VB) to communicate with PSoC5

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Use Visual Basic (VB) to communicate with PSoC5
Moderator:
ANCY

Post Reply
Follow this topic



Use Visual Basic (VB) to communicate with PSoC5

Swee Huei posted on 28 Mar 2012 2:38 AM PST
Top Contributor
33 Forum Posts

I am a newbie to PSoC5.

Presently I would like to program the PSoC5 as a simple I/O card, and to communicate with Visual Basic thru USB port.

Basically the PSoC5 chip will function as an I/O card.

For eg, when I want to use P0(0) as an output port to control the coil of a relay, the VB GUI will communicate with the PSoC5 chip thru the USB port of the CPU, and then the GUI will send a stream of data to the PSoC5 to ask the PSoC5 to output a high voltage level from P0(0) port.

In this case, I need to write a VB source code and also a PSoC5 source code. 

I need help on how to start to write the PSoC5 source code. Can anybody advise?

Thanks in advance.  




Re: Use Visual Basic (VB) to communicate with PSoC5

Bob Marlowe posted on 28 Mar 2012 02:48 AM PST
Top Contributor
1768 Forum Posts

To make things easier, I would start with USBUART in PSoC5. This will reduce the amount of VB-programming, you may use a simple terminal-pprogram to access your PSoC-board.

 

On the PSoC-side you MUST use C as programming language. Together with the PSoC Creator 2.0 there is a free Gnu C-compiler for the ARM-core. Many examples are just a mouse-click away.

If you din't already got one, I would suggest to get a Kit-001 which is VERY versatile. Look here at Cypress's webside for a description.

 

Happy coding

Bob 



Re: Use Visual Basic (VB) to communicate with PSoC5

U2 posted on 29 Mar 2012 02:38 AM PST
Cypress Employee
589 Forum Posts

The first thing you should be doing is to get a PSoC code running which can toggle a Pin state. Then have an external control to control this Pin state. May be set the Pin if the switch is pressed and likewise. Then bring in the USB part. You can access any USB device including PSoC from a VB .NET application. You can find help on how to develop your VB application on web. However in order to access the USB device, Cypress provides a standard DLL CyUSB.dll. It is a part of SUITE USB, which can be downloaded here, http://www.cypress.com/?rID=34870. I would suggest you to first get started with PSoC5 and then move to VB and USB portion.



Re: Use Visual Basic (VB) to communicate with PSoC5

U2 posted on 29 Mar 2012 02:39 AM PST
Cypress Employee
589 Forum Posts

 You can get started with PSoC by visiting this page, http://www.cypress.com/?id=2233&tabID=38413



Re: Use Visual Basic (VB) to communicate with PSoC5

kmmankad posted on 29 Mar 2012 04:27 AM PST
Top Contributor
268 Forum Posts

Since youre getting started with PSoC,even I'd suggest you use the UART or USBUART.It will make PC side coding much easier.Note that this will require you to install USBUART drivers.

Find the example project in PSoC creator by right clicking on the USB UART block,and clicking 'Find Example Project'.

 

USB HID is better,but then PC side coding is something that might be intimidating at first,compared to coding for USB UART.

All the best!



Re: Use Visual Basic (VB) to communicate with PSoC5

U2 posted on 30 Mar 2012 11:10 PM PST
Cypress Employee
589 Forum Posts

 I will have to agree with kmmankad.



Re: Use Visual Basic (VB) to communicate with PSoC5

Eilrem posted on 04 Apr 2012 12:33 AM PST
Cypress Employee
17 Forum Posts

AN2298 is for PSoC1 but its VB6 code is a good example to directly interface to the USB HID.



Re: Use Visual Basic (VB) to communicate with PSoC5

Swee Huei posted on 05 Apr 2012 01:57 AM PST
Top Contributor
33 Forum Posts

Dear all,

Thanks for all your suggestions.



Re: Use Visual Basic (VB) to communicate with PSoC5

jacktan posted on 26 Apr 2012 08:47 AM PST
Top Contributor
26 Forum Posts

I like this topic and learn something i need  from the discuss!






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20