News:

Let's find out together what makes a PIC Tick!

Main Menu

StarrtUSB board

Started by Yves, Aug 06, 2021, 08:11 AM

Previous topic - Next topic

Yves

Hello all,
I bought a StartUsb board fitted with the 18F2550 chip at https://www.mikroe.com/startusb-pic to try my hand with USB programming and get red of the pickit3 programmer. I think it is the way to go. I wrote a short code  using Positron compiler and managed to flash the pic using the Mikrobootloader to flash 2 LED fitted on the board. It worked perfectly. My question is: how do i communicate to my PC texts and data via the USB port. I would like eventually get data to excel using the excellent PLX-DAQ from Parallax. The protocol is HID.
Many thanks in advance.
STARTUSB.jpg

Regards,

Yves   
Yves

towlerg

I had a real quick look at PLX-DAQ, seems like you don't have to do anything other than display the spreadsheet. If you intend to go to the expense of using an of-the-shelf solution why bother with duplicating the effort. A PC program to gather data is relly not that tough, its the interface to Excel that a bitch. I wouldn't claim to know how to do that, COM perhaps or that funny basic for Office thing.

tumbleweed

#2
QuoteI would like eventually get data to excel using the excellent PLX-DAQ from Parallax. The protocol is HID.
AFAIK, PLX-DAQ uses a serial COM port connection to get its data, so on the pic side you'd have to use USB CDC to get a virtual COM port, not HID

You could still use HID for the bootloader, though.

trastikata

#3
In the Wiki I posted a "Framework" how to receive data from the PIC MCU through the HID USB port and display it in a Windows Form.

Here's a simple example how to pass data from the Windows Form to Excel in real time. In this application every time you press "Enter", the data is passed to a new cell in a custom Excel file.

Keep in mind that this a minimum code just to help you out where to start with no "stops and checks", a real application would require more attention to make it stable for the regular user. 

VB.NET FORM TO EXCEL.zip



VBNETTOEXCEL.jpg

Yves

Hello
PLX-DAQ works pretty well when you have serial protocol. I had some success testing the 18F2550 with the Microelectronica bootloader and using some CDC driver and examples from the Positron manual. I have no been able though to pass thing like numerical variables like word or float variables yet. it looks likes you can only send strings. I have three questions
 1) how do you pass USBOut variables?.
 
2) is it possible to USBOut line like this (Hrsout) "DATA,", DEC Val1, ",", DEC Val2, CR the same way I send serial data? which is the format for PLX-DAQ.

3) What you guys are using as USB boot loader and after have place the boot loader is there is chances to overwrite it when you flash you code?
   
I would appreciate if someone could send or point me out a SIMPLE CDC protocol code that I could adapted to my project. Many thanks in advance.

Regards,

Yves     
Yves

Yves

Problem solved,

I found an excellent CDC example in PDS sample file called USB_ADC.bas. It was exactly what I needed. Many thanks.

Regards,

Yves
Yves