Simplified Microchip PIC USB demos (C18/XC8 MLA)

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

Postby vloki » Mon Aug 10, 2015 12:45 pm

deiv23 wrote:This is the rawdata I obtain. The write packet is the one I'm sending, just setted the first bytes to 12, ff, 00, ff....


Try to send a valid command for the unmodified software !
x01 x31 (one byte cmd - LED_3 on) for example.


x01 x0F (for the device name request)
x01 x10 (old style device name request)
screenshot31.png
screenshot31.png (17.92 KiB) Viewed 8187 times
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 deiv23 » Mon Aug 10, 2015 4:33 pm

same results
deiv23
 
Posts: 12
Joined: Fri Aug 07, 2015 12:21 pm

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

Postby deiv23 » Mon Aug 10, 2015 6:35 pm

when i select the hid view in the sniffer, the packets are shown in a strange way, like it is not recognizing the format.

Maybe I'm not sending it in the proper way? I'm sending first byte to 0x00 (this is the report number?, it only works if this value is 0x00) and then I write the data, for example : x01 x0F (for the device name request)
deiv23
 
Posts: 12
Joined: Fri Aug 07, 2015 12:21 pm

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

Postby vloki » Tue Aug 11, 2015 7:49 am

deiv23 wrote:same results

With what you are doing ?
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 vloki » Tue Aug 11, 2015 7:51 am

deiv23 wrote:when i select the hid view in the sniffer, the packets are shown in a strange way, like it is not recognizing the format.

Maybe I'm not sending it in the proper way? I'm sending first byte to 0x00 (this is the report number?, it only works if this value is 0x00) and then I write the data, for example : x01 x0F (for the device name request)


HID view is not available in my version. I only can select URB and Packet view.
The first byte is the endpoint number.
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 deiv23 » Wed Aug 12, 2015 9:23 am

I wasn't telling you that I'm using PIC18f24k50. Ignorance made me think that it wasn't that important...

I'm using the configuration pdusb_25k50 for XC8 and only had to comment some lines (6 lines) beginning with #pragma config that correspond to registers that are not present in my pic.

I'm reading the the part of the datasheet where talks about the USB module and seems that some configurations like the frequency of the clock provided to the USB module are correct.

But I guess that is not that easy...
deiv23
 
Posts: 12
Joined: Fri Aug 07, 2015 12:21 pm

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

Postby vloki » Wed Aug 12, 2015 9:47 am

The only difference between 24K50 and 25K50 should be the memory size.
So yes, you have to comment the configs related to the not available memory.

If the project compiles, the pic shows up in windows and you can communicate,
everything should be OK for the beginning.

Did you try to send something with my executable?
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 deiv23 » Wed Aug 12, 2015 9:49 am

I got it working!!!!!

I had to add this:

Code: Select all
#elif defined(__18F24K50)
    #include "../BSP-FILES/pdusb_25K50.h"
#else


it wasn't including that file for my pic
Thank's for the help and for your project, it works great.
deiv23
 
Posts: 12
Joined: Fri Aug 07, 2015 12:21 pm

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

Postby deiv23 » Wed Aug 12, 2015 12:52 pm

Do you think it's possible to change the packets size to 256?

I'm changing the report count to 0xFF in usb_descriptors.c, and increase the size of the ReceivedDataBuffer to 256 (changed the fixed memory positions too).

Now I send 256 bytes packets but all the data from byte 64 is ignored...
deiv23
 
Posts: 12
Joined: Fri Aug 07, 2015 12:21 pm

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

Postby vloki » Wed Aug 12, 2015 1:09 pm

deiv23 wrote:Do you think it's possible to change the packets size to 256?
...

No, for Interrupt transfer on full speed devices 64 bytes is the maximum
see: USB in a NutShell - Chapter 4 - Endpoint Types http://www.beyondlogic.org/usbnutshell/usb4.shtml
vloki
Verified identity
 
Posts: 186
Joined: Wed May 28, 2014 8:42 am
Location: Germany
PIC experience: Professional 5+ years with MCHP products

PreviousNext

Return to USB

Who is online

Users browsing this forum: No registered users and 6 guests

cron