|
|
Re:Basic USB - Using Microchip Stack and C#.Net
|
|
Date: 2007/11/23 11:33
|
By: dariog
|
Status: User
|
|
|
Karma: 6  
|
|
| Posts: 107 |   | |
|
Sure you can. You can have a HID device sending its own data to the PC, without waiting for any "start" from that side. But, if the USB Pipe is not ready to receive (i.e. USB not enumerated/installed correctly), at some point your PIC will stop and wait for data to go through.
|
|
|
|
|
|
Re:Basic USB - Using Microchip Stack and C#.Net
|
|
Date: 2008/02/13 08:14
|
By: Ma
|
Status: Visitor
|
|
|
|
|
|
|
Need some help....
I'm using a 18f2550 for this project. Change .lkr files and io_cfg.h to the respectable ports (port d to b) I'm using a 4Mhz crystal.
The PC keep giving me "USB device not recognized..." msg...
What configuration bits should i set on the oscillator setup??
Ma
|
|
|
|
|
|
Re:Basic USB - Using Microchip Stack and C#.Net
|
|
Date: 2008/02/13 16:44
|
By: DLChambers
|
Status: Visitor
|
|
|
|
|
|
|
How important is it that the cap be 470nf? I used a 1uf (~2x 470nf), and my Vusb is 3.3v, but i'm getting the "device not recognized" message and my PIC's USB node is in the SUSPEND state (both LEDs flashing in unison).
|
|
|
|
|
|
Re:Basic USB - Using Microchip Stack and C#.Net
|
|
Date: 2008/02/28 15:09
|
By: Nevalon
|
Status: Visitor
|
|
|
|
|
|
|
Hi.
First of all - thanks for Your work ;]
I'm trying to implement Your code on PIC18F87J50. For now I'm thinking about conception how to do it, may You tell me what You think about it?
The board and PIC will have their own power, I need PIC circuit running no matter it is connected to the PC or not. PC application will collect informations from PIC only.
I looked at Your code and I don't really know (maybe I only don't understand - I'm not an electronic, i'm programmist, and in addition my English is not very good - I'm from Poland) do I need USE_SELF_POWER_SENSE_IO defined? I know I need USE_USB_BUS_SENSE_IO defined because of USB protocol and I understand (or am I wrong?) that when signal on Vusb from PC-host arrives (it should be connected to Vusb pin and RA1 pin, shouldn't it?) the resistor 4.7k delays it before it arrives to RA1 and after it arrives to RA1 (not to Vusb, on which the signal will be earlier) the USB procedures on PIC will start.
If I understand OK tell it, if not - correct me please.
And some questions: 1. "Self power" means internal (just from USB ) or external power source? 2. Why do I need RA2 input when it is self powered? Neighter on schematics nor in text below we have no connection to this pin. 3. May I have USB connection with PC and USART connection with other PIC? 4. Do I need any changes in code for migrate from 4550 to 87J50? I just changed Device in MPLAB and linker for proper...
|
|
|
|
|
|
Re:Basic USB - Using Microchip Stack and C#.Net
|
|
Date: 2008/04/06 14:14
|
By: AlexD
|
Status: Visitor
|
|
|
|
|
|
|
Hi to all!
Thank you Mat for your excellent Article!
I have no clue why the PIC does not respond to changes in USER.C: If I comment out the Line
| Code: | mLED_3_On();mLED_4_On();
|
within the switch block of ServiceRequests I can still switch on both LEDs.
(attach to USB, start Program, initially both LEDs off and the two boxes unchecked, now check both boxes and hit Update - both LEDs light up)
What did I mis - I am sure there must be something I've missed?
I realized it when I connected a LCD and initialized it in UserInit it worked fine, even it string output worked well inside UserInit.
Adding code insidethe switch block of ServiceRequests shows no response, just the LEDs respond like they are supposed to by Mats original code.
I am looking forward to your answers.
Alex
@Nevalon: I will answer some of your questions to my best knowledge which is very limited concerning USB.
Self power senses presence of an external power source ( not USB supplied ). It does not look to be of any use to me... just comment it out.
The Vusb Pin on the PIC needs a capacitor ( 470nF I think ) attached to GND which is necessery for the internal USB voltage regulator.
Since I assume your PIC needs a Vdd of 3.3V I do not know whether it requires something different ( compared to 18F4550 with Vdd of 5V ).
|
|
|
|
|
|
Re:Basic USB - Using Microchip Stack and C#.Net
|
|
Date: 2008/04/13 01:20
|
By: David
|
Status: Visitor
|
|
|
|
|
|
|
bugger lost message
but hey I was just saying Hello
and I need some help with the pc side of the usb program 
David
|
|
|
|
|
|
Re:Basic USB - Using Microchip Stack and C#.Net
|
|
Date: 2008/04/13 01:21
|
By: David
|
Status: Visitor
|
|
|
|
|
|
|
bugger lost message
but hey I was just saying Hello
and I need some help with the pc side of the usb program 
David
|
|
|
|
|
|
Re:Basic USB - Using Microchip Stack and C#.Net
|
|
Date: 2008/04/17 18:07
|
By: Gerardo
|
Status: Visitor
|
|
|
|
|
|
|
Hello everybody: I am programming a PIC18F4550 with USB interface. I am also viewing the information it exchanges with the PC using a USB Tracer.
What I really can not understand is why the host (PC) transmit two packets instead of only one (I am sure that the program only sends one), and then there is the answer of the PIC, but with some IDLE packets in between... is the PIC slow, and for that reason the communications has these IDLE packets?
I attach here a little USB Log I have obtained. You will see that Request #1 and #2 are the same. Then there are two answer from the PIC (Reqeust #3 adn #4). But, #5 is and IDLE packet (maybe because the host couldn´t recognize on time the first packet --see request #3) and finally #6 is another new packet from the next sequence. This sequence repeats every time I try to send only one packet and receive its corresponding answer. It is, I want to see only 2 packets instead of 5.
Thanks in advance, Gerardo.
--------- Request # 1 ----[OUT]----
URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER
IRP: 0x87304228 Status: STATUS_SUCCESS (0x0) Device Object: 0x86419D50
Length: 0x48 USBD Status: USBD_STATUS_SUCCESS (0x0) EndpointAddress: 0x1 PipeHandle: 0x81E65044 TransferFlags: 0x0 ( USBD_TRANSFER_DIRECTION_OUT ) TransferBufferLength: 0x40 TransferBuffer: 0x0 TransferBufferMDL: 0x85F9ABC8 UrbLink: 0x0
** Data ** 00 02 0C 00 4E 01 02 0D 00 4E 02 02 0E 00 4E 03 03 11 64 00 00 04 03 11 E4 00 00 05 03 11 E4 00 00 06 03 11 64 00 00 07 03 11 E4 00 00 08 03 11 E4 00 00 09 02 0C 00 4E 0A 00 F0 00 00 00 00 00
--------- Request # 2 ----[OUT]----
URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER
IRP: 0x87304228 Status: STATUS_SUCCESS (0x0) Device Object: 0x828E2200
Length: 0x48 USBD Status: USBD_STATUS_SUCCESS (0x0) EndpointAddress: 0x1 PipeHandle: 0x81E65044 TransferFlags: 0x0 ( USBD_TRANSFER_DIRECTION_OUT ) TransferBufferLength: 0x40 TransferBuffer: 0x0 TransferBufferMDL: 0x85F9ABC8 UrbLink: 0x0
** Data ** 00 02 0C 00 4E 01 02 0D 00 4E 02 02 0E 00 4E 03 03 11 64 00 00 04 03 11 E4 00 00 05 03 11 E4 00 00 06 03 11 64 00 00 07 03 11 E4 00 00 08 03 11 E4 00 00 09 02 0C 00 4E 0A 00 F0 00 00 00 00 00
--------- Request # 3 ----[IN]----
URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER
IRP: 0x87304228 Status: STATUS_PENDING (0x103) Device Object: 0x828E2200
Length: 0x48 USBD Status: USBD_STATUS_PENDING (0x40000000) EndpointAddress: 0x1 PipeHandle: 0x81E65044 TransferFlags: 0x0 ( USBD_TRANSFER_DIRECTION_OUT ) TransferBufferLength: 0x0 TransferBuffer: 0x0 TransferBufferMDL: 0x85F9ABC8 UrbLink: 0x0
--------- Request # 4 ----[IN]----
URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER
IRP: 0x87304228 Status: STATUS_SUCCESS (0x0) Device Object: 0x828E2200
Length: 0x48 USBD Status: USBD_STATUS_SUCCESS (0x0) EndpointAddress: 0x1 PipeHandle: 0x81E65044 TransferFlags: 0x0 ( USBD_TRANSFER_DIRECTION_OUT ) TransferBufferLength: 0x40 TransferBuffer: 0x0 TransferBufferMDL: 0x85F9ABC8 UrbLink: 0x0
--------- Request # 5 ----[OUT]----
IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION
IRP: 0x8702C008 Status: STATUS_SUCCESS (0x0) Device Object: 0x86419D50
--------- Request # 6 ----[OUT]----
URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER
IRP: 0x87212DF8 Status: STATUS_SUCCESS (0x0) Device Object: 0x86419D50
Length: 0x48 USBD Status: USBD_STATUS_SUCCESS (0x0) EndpointAddress: 0x81 PipeHandle: 0x81E65024 TransferFlags: 0x3 ( USBD_TRANSFER_DIRECTION_IN USBD_SHORT_TRANSFER_OK ) TransferBufferLength: 0x40 TransferBuffer: 0x0 TransferBufferMDL: 0x875829A8 UrbLink: 0x0
|
|
|
|
|
|
Re:Basic USB - Using Microchip Stack and C#.Net
|
|
Date: 2008/05/21 07:52
|
By: Balkar
|
Status: Visitor
|
|
|
|
|
|
|
Hi to everyone,
Very nice work first of all. I was wondering if we could reach faster transfer rates in PC-PIC communication. I am trying to send for example 64Kbyte of data in one second assuming that the pic transmits packets in every one ms. But i can only send 4Kbyte of data in one sec. By the way I am using CDC type, not generic class. I hope it does not differ much, but I thought CDC might be faster. Anyway, what I would like to do is to use as fast as it can, and does anybody know how.
Regards, Balkar
|
|
|
|
|
|
Re:PICDEM FS USB Code
|
|
Date: 2008/06/11 17:32
|
By: Terry
|
Status: Visitor
|
|
|
|
|
|
|
Fauzan wrote: I just got a PICDEM FS USB board... I was just trying the code in your article...I got a build error
"Executing: "C:MCC18binmcc18.exe" -p=18F4550 /i"C:picusbdemo" "main.c" -fo="C:PICUSB~2main.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- C:picusbdemomain.c:38:Error [1027] unable to locate 'p18cxxx.h'
Where can i find this p18cxxx.h?
Is it important, because the board comes with P18F4550?
Thanks Fauzan
|
|
|
|
|
|
Re:PICDEM FS USB Code
|
|
Date: 2008/06/11 18:59
|
By: slobo
|
Status: Visitor
|
|
|
|
|
|
|
Fauzan wrote: I just got a PICDEM FS USB board... I was just trying the code in your article...I got a build error
"Executing: "C:MCC18binmcc18.exe" -p=18F4550 /i"C:picusbdemo" "main.c" -fo="C:PICUSB~2main.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- C:picusbdemomain.c:38:Error [1027] unable to locate 'p18cxxx.h'
Where can i find this p18cxxx.h?
Is it important, because the board comes with P18F4550?
Thanks Fauzan
|
|
|
|