Help me with Kwikstik USB O-scope project?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help me with Kwikstik USB O-scope project?

713 Views
Spikey_Mikey
Contributor II

I want to turn my Kwikstick into an O-scope for a fun side project and would love some tips so I don't have to reinvent the wheel.  I am running CW10.2 and am planning to use processor expert and no OS.

 

I am very familiar with PE and the ADC side of things, but I have never used a USB peripheral on a device.  Does anyone have any tips or example projects that show how to send data across the USB port and then how to grab that data in a Visual C++, C#,Visual Basic, Java, or other  program?

 

Thanks in advance!

0 Kudos
2 Replies

462 Views
Jim_P
Contributor III

For my PC programing I use Delphi,  There are many components included, and many free, components. One is HID for USB.

This allows setting up the USB port and interfacing to the USB port and connected hardware in many of the common modes, such as Mouse, keyboard type of devices up to external memory or scanner type of device.

 

The newest version, XE2, allows for compiling for win 7 32 bit or 64 bit, IMac, IPhone and IPad.

 

Jim P

0 Kudos

462 Views
mjbcswitzerland
Specialist V

Hi

 

To avoid complications at the PC side consider using CDC class (Communication Device Class) since this allows the device to be seen as a virtual COM port and any PC code that you have that can read data coming in from a COM port will be compatible with it coming in over the virtual COM port (USB device) [using the COM port on the PC is very simple]. If you make a new (custom) class you may spend more time on trying to get it working (or end up having to buy an expensive driver from one of the PC USB driver specialists) on the PC side than it is worth (notice that the majority of PC drivers for embedded 'things' - including some freescale debuggers, come from Jungo; developing such a PC USB device driver for such things is quite a specialist task and that is why they can also command quite high prices for their products). The CDC driver come as part of Windows and so makes life easier - even if people will explain that it is not very good; it serves the purpose in most projects.

 

This also allows you to make a first application which feeds the data from the board via a UART. This will not be as fast as USB (eg. 115k rather than about 10Mb/s) but, once it works, you can 'simply' switch the UART handle over to the USB handle and it will work the same (on Kinetis and on the PC) but with the final higher data rate.

 

There are some ideas about USB device CDC here: http://www.utasker.com/docs/uTasker/USB_User_Guide.PDF

This solution allows the USB interface to look like a UART interface from the point of view of the embedded SW (thus switching between UART and USB is as simple as setting the interface handle variable with the interface handle to be used (it is also true for TELNET when working with a K60, which would allow either UART, USB or TCP for the transfer - or a mixture of them).

 

Regards

 

Mark

 

0 Kudos