!Ray of hope!: PIC24FJ256GB106 USB Serial not initialize

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: PIC24FJ256GB106 USB Serial not initialize wrong Sequence

Post by Rudi »

Hi Guys, Hi MM,

i have a play this weekend again in this.
i added a CSV LOG from a running USB Serial with the same PIC24 Board.

This is the USB Serial Initialize Start Procedure with the PIC24 DEMO ( Microchip - Shure electronic ) taken from the MPLAP Demo -
i added this in this thread earlier with all electric shema and src code in MPLAP. ( Shure )

For compare with the FC Initialize seq ( 1 - 134 ) I added the CSV Log. Please remove the last ".zip" i added this only for upload limitation´

Edit:
I added the Flowcode USB Initialize seq (1 - 176 ) for compare with the CDC Demo from microchip.
134 is the end in the Demo.
Flowcode produce from 135 - 176 more... Perhabs the Pipe's for ping-pong going across?

I added the USB View from Flowcode USB Serial

Code: Select all


Device Descriptor:
bcdUSB:             0x0200
bDeviceClass:         0x02
bDeviceSubClass:      0x00
bDeviceProtocol:      0x00
bMaxPacketSize0:      0x08 (8)
idVendor:           0x12BF
idProduct:          0xF010
bcdDevice:          0x0100
iManufacturer:        0x01
0x0409: "Flowcode USB Serial"
iProduct:             0x02
0x0409: "Matrix Multimedia Ltd."
iSerialNumber:        0x00
bNumConfigurations:   0x01

ConnectionStatus: DeviceConnected
Current Config Value: 0x01
Device Bus Speed:     Full
Device Address:       0x01
Open Pipes:              3

Endpoint Descriptor:
bEndpointAddress:     0x82
Transfer Type:   Interrupt
wMaxPacketSize:     0x0008 (8)
bInterval:            0x02

Endpoint Descriptor:
bEndpointAddress:     0x03
Transfer Type:        Bulk
wMaxPacketSize:     0x0040 (64)
bInterval:            0x00

Endpoint Descriptor:
bEndpointAddress:     0x83
Transfer Type:        Bulk
wMaxPacketSize:     0x0040 (64)
bInterval:            0x00

Configuration Descriptor:
wTotalLength:       0x0043
bNumInterfaces:       0x02
bConfigurationValue:  0x01
iConfiguration:       0x00
bmAttributes:         0xC0 (Bus Powered Self Powered )
MaxPower:             0x32 (100 Ma)

Interface Descriptor:
bInterfaceNumber:     0x00
bAlternateSetting:    0x00
bNumEndpoints:        0x01
bInterfaceClass:      0x02
bInterfaceSubClass:   0x02
bInterfaceProtocol:   0x01
iInterface:           0x00

Unknown Descriptor:
bDescriptorType:      0x24
bLength:              0x05
05 24 00 10 01 

Unknown Descriptor:
bDescriptorType:      0x24
bLength:              0x04
04 24 02 02 

Unknown Descriptor:
bDescriptorType:      0x24
bLength:              0x05
05 24 06 00 01 

Unknown Descriptor:
bDescriptorType:      0x24
bLength:              0x05
05 24 01 00 01 

Endpoint Descriptor:
bEndpointAddress:     0x82
Transfer Type:   Interrupt
wMaxPacketSize:     0x0008 (8)
bInterval:            0x02

Interface Descriptor:
bInterfaceNumber:     0x01
bAlternateSetting:    0x00
bNumEndpoints:        0x02
bInterfaceClass:      0x0A
bInterfaceSubClass:   0x00
bInterfaceProtocol:   0x00
iInterface:           0x00

Endpoint Descriptor:
bEndpointAddress:     0x03
Transfer Type:        Bulk
wMaxPacketSize:     0x0040 (64)
bInterval:            0x00

Endpoint Descriptor:
bEndpointAddress:     0x83
Transfer Type:        Bulk
wMaxPacketSize:     0x0040 (64)
bInterval:            0x00



Thank you!
best wishes
Rudi
;-)

Edit:
I added a USB View of the Initialize ..
strange - not all Enpoints are listed.
..
..
but it works as USB Serial .

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: !Ray of hope!: PIC24FJ256GB106 USB Serial not initialize

Post by Rudi »

;-)

Hi Guys,

short and inform ;-)

i transfered successfull the runing MPLAP USB Serial Project to Flowcode ;-) for pic24 ;-) la la lalala la la la he he ;-)

wow - FC is really great! ( Thanks to Benj & Leigh for constructive help and all the other ..VC*s..( Jac & Martin ) and the MM Staff)
many more questions now are ;-) for the big function pool in FC .. ( the most function in Flowcode are in the background - but this will learn step by step in doing. )
a little bit more in Online Help or Offline Help for can reading Details by annoying users like me :-) will help more MM Staff!
Perhabs you can thinking about the possibles to make a Offline Help in future, i wishes this for future, or a download availabel wiki pdf possible.

I will try to document my steps in Detail next Time.
And try to resume all in this as a ask and answere.

The aim was to achieve:
Testing the Config between MPLAP and Flowcode.
and: OK - settings are ok,

the next step was:
integration USB Serial ;-)...
and: ;-) yeah!!!

USB Serial for PIC24 works in Flowcode now!
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
but!

i am unsure in this PIC24FJGB106 Board from, SHURE .....
...so i take my modified USB Files now and i used my own USB Serial Routines that was created step by step last 5 month ;-)
it works in FC ;-)
i can communication between PC <-> Device by USB Serial .. Baudrate is ok too.

for flashing 1s:1s i used 12000000 in clock in project properties.

Result:
There are little difference in USB Serial Component FC.
The point is, USB can manage by Interrupt or polling
If polling, must call the USBDeviceTask() periodically.
..

the next step is:
to make the USB Serial Compo as a "Flowcode Project" that i can upload here for analyse this by yours , and what difference is to the orig USB Serial Compo.
The Communication between PC and Device is verry verry sensible.. but this Test was the Best in Doing to understand and learn how USB "ticked" ;-)

little Differences in usb_function_cdc.c MPLAP : Flowcode

example

Code: Select all

volatile FAR unsigned char cdc_data_rx.....
^^^^^^^^^^
volatile FAR unsigned char cdc_data_tx.....
^^^^^^^^^^
was step by step - row by row - tested.

i hope i can finnish this asap and then i post all Info.

My next steps are:
document all my changes by me that you can comprehend this steps.

Yeah!
Have a nice Weekstart MM!
Now i have a big Ray of hope in PIC24/FC
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


I was very despair.
But since I have learned FC appreciate, this was one of my goals.

Now it goes ahead!
It goes forward only.

Next steps..
HID
SLAVE
..
USB HOST..

Reverse was yesterday.

Best wishes MM!!
Rudi
;-)

Post Reply