Page 9 of 10

Re: Simplified Microchip PIC USB demos (C18/XC8 MLA)

PostPosted: Mon Apr 04, 2016 12:40 pm
by susi
I think it's the routine of the usblyzer! but I think there should be no difference between multiple times of pressing a specific button on the hid-demo.exe....
2- yeah!
3- yes, you are right.
3a- really?! ooooooooooooohh

Re: Simplified Microchip PIC USB demos (C18/XC8 MLA)

PostPosted: Mon Apr 04, 2016 12:43 pm
by susi
I really APPRECIATE YOU VLOKI. thanx again.

Re: Simplified Microchip PIC USB demos (C18/XC8 MLA)

PostPosted: Mon Apr 04, 2016 2:41 pm
by vloki
Of course there should be no difference.
The first response should be the 0xF0 and then the 0x7...

BTW:
There is an ERROR in my code - should be ToSendDataBuffer[2+i] = packet_num;
Please correct this first if you not already did and see what happens.

Re: Simplified Microchip PIC USB demos (C18/XC8 MLA)

PostPosted: Tue Apr 05, 2016 4:56 am
by susi
There is an ERROR in my code - should be ToSendDataBuffer[2+i] = packet_num;
Please correct this first if you not already did and see what happens.

I know; the "0x20" after the 0x71, 0x72,... will be omitted.

Of course there should be no difference.

so what's the reason of the difference?

Re: Simplified Microchip PIC USB demos (C18/XC8 MLA)

PostPosted: Wed Apr 06, 2016 6:42 am
by susi
my code for the PC_side was correct. now I can send and receive data properly.
Code: Select all
case CID_EEREAD:  //data from eeprom to pc
         for (int packet_num = 0; packet_num < max_packet_num ; packet_num++)
         {
               io_result = hid_read(connected_device, inBuffer, 65);
               for (long int count = 0; count < 65; count++){
                  long int numm = count + packet_num * 64;
                  my_store[numm] = inBuffer[count];
               }
}
         myfile.open("file.txt", ios::out | ios::binary);
         for (int ii=0 ; ii < 600 ; ii++)
         myfile << " " << hex << int(my_store[ii]) << endl;
         myfile.close();
       break;

Re: Simplified Microchip PIC USB demos (C18/XC8 MLA)

PostPosted: Sat Apr 16, 2016 9:07 pm
by Jitz04
Hi @vloki, I'm using revision r4 of your HID firmware (PIC18F4550 XC8) and the application in Qt Creator. Working wonderfully might i add.

I was wondering if it is possible to use and send more than one ADC value from multiple ports and how? Tried to figure it out from the firmware but figured that if you can only use one channel at a time, you be restricted to a single port?

Thanks.

Re: Simplified Microchip PIC USB demos (C18/XC8 MLA)

PostPosted: Sun Apr 17, 2016 11:26 am
by vloki
Jitz04 wrote:I was wondering if it is possible to use and send more than one ADC value from multiple ports and how?

The demo shows a basic communication only. Of course you can modify it to your needs.
How many channels and at which sample rate?

I probably would set up ADconversion based on a special event trigger that fills a buffer.
The buffer could be send like susi's EEPROM data from above ...

Re: Simplified Microchip PIC USB demos (C18/XC8 MLA)

PostPosted: Tue May 31, 2016 9:16 pm
by r720
Hi vloki.

I'm trying to compile your HID firmware r4, and I get a "conflicting declarations" error for variable _INTCONbits:

Code: Select all
Microchip MPLAB XC8 C Compiler (PRO Mode) V1.37
Build date: Mar 10 2016
Part Support Version: 1.37
Copyright (C) 2016 Microchip Technology Inc.
License type: Node Configuration

:: advisory: (1233) Employing 18F4550 errata work-arounds:
:: advisory: (1234)  * Corrupted fast interrupt shadow registers
make[2]: *** [dist/PDFSUSB_4550_XC8/production/LPC_FSUSB-HID-X.X.production.hex] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
C:\Program Files (x86)\Microchip\xc8\v1.37\include\pic18f4550.h:9211: error: (1098) conflicting declarations for variable "_INTCONbits" (C:\Program Files (x86)\Microchip\xc8\v1.37\include\pic18f4550.h:8963)
(908) exit status = 1
nbproject/Makefile-PDFSUSB_4550_XC8.mk:215: recipe for target 'dist/PDFSUSB_4550_XC8/production/LPC_FSUSB-HID-X.X.production.hex' failed
make[2]: Leaving directory 'D:/Libraries/Travail/PIC Microcontrollers/18f2550/LPC_FSUSB-HID-X-r4a/LPC_FSUSB-HID-X.X'
nbproject/Makefile-PDFSUSB_4550_XC8.mk:78: recipe for target '.build-conf' failed
make[1]: Leaving directory 'D:/Libraries/Travail/PIC Microcontrollers/18f2550/LPC_FSUSB-HID-X-r4a/LPC_FSUSB-HID-X.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed

BUILD FAILED (exit value 2, total time: 955ms)


Do you have an idea where could be the problem?
I'm using XC8 v1.37 with PLIB installed.

Thanks a lot

Re: Simplified Microchip PIC USB demos (C18/XC8 MLA)

PostPosted: Wed Jun 01, 2016 7:46 am
by vloki
The libraries are worthless now with newer versions of XC8 because
some "cleanups" in the newer versions header files :-(

- > http://www.microchip.com/forums/FindPost/896907

Re: Simplified Microchip PIC USB demos (C18/XC8 MLA)

PostPosted: Sun Jan 08, 2017 10:18 am
by 6O6A9R1VP
Hi Vloki,
:)
I am using LPC_FSUSB-CDC-X-r3 code for my project using 18f4550 in MPLAB-XC8. It compiled with out any changes. I am monitoring temperature & pressure variables. They are to be updated periodically in GUI. I compiled your serial commn code as it is. It is not compiling, with message "The build directory needs to be at the same level as the source directory". Please tell me what has gone wrong. :idea: