Simplified Microchip PIC USB demos (C18/XC8 MLA)

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

Postby susi » Mon Apr 04, 2016 12:40 pm

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
susi
 
Posts: 9
Joined: Wed Mar 30, 2016 6:02 am
PIC experience: EE Student

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

Postby susi » Mon Apr 04, 2016 12:43 pm

I really APPRECIATE YOU VLOKI. thanx again.
Last edited by susi on Wed Apr 06, 2016 7:10 am, edited 1 time in total.
susi
 
Posts: 9
Joined: Wed Mar 30, 2016 6:02 am
PIC experience: EE Student

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

Postby vloki » Mon Apr 04, 2016 2:41 pm

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.
vloki
Verified identity
 
Posts: 186
Joined: Wed May 28, 2014 8:42 am
Location: Germany
PIC experience: Professional 5+ years with MCHP products

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

Postby susi » Tue Apr 05, 2016 4:56 am

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?
susi
 
Posts: 9
Joined: Wed Mar 30, 2016 6:02 am
PIC experience: EE Student

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

Postby susi » Wed Apr 06, 2016 6:42 am

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;
susi
 
Posts: 9
Joined: Wed Mar 30, 2016 6:02 am
PIC experience: EE Student

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

Postby Jitz04 » Sat Apr 16, 2016 9:07 pm

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.
Jitz04
 
Posts: 1
Joined: Tue Apr 12, 2016 7:34 pm

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

Postby vloki » Sun Apr 17, 2016 11:26 am

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 ...
vloki
Verified identity
 
Posts: 186
Joined: Wed May 28, 2014 8:42 am
Location: Germany
PIC experience: Professional 5+ years with MCHP products

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

Postby r720 » Tue May 31, 2016 9:16 pm

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
r720
 
Posts: 1
Joined: Tue May 31, 2016 8:57 pm

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

Postby vloki » Wed Jun 01, 2016 7:46 am

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
vloki
Verified identity
 
Posts: 186
Joined: Wed May 28, 2014 8:42 am
Location: Germany
PIC experience: Professional 5+ years with MCHP products

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

Postby 6O6A9R1VP » Sun Jan 08, 2017 10:18 am

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:
6O6A9R1VP
 
Posts: 3
Joined: Sun Dec 18, 2016 12:13 pm
PIC experience: Experienced Hobbyist

PreviousNext

Return to USB

Who is online

Users browsing this forum: No registered users and 2 guests

cron