Announcement

Collapse
No announcement yet.

Working to become proficient at USB Implementation on PIC 18 series

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Working to become proficient at USB Implementation on PIC 18 series

    I've been studying the PBP3 files in the "USB18" directory of the PBP3 source directory. I have successfully tested all 3 of the provided with PIC18F4550 on a knock-off PICDEM board. I am now trying to understand all the necessary processes and code operations bundled up in the 3 sample applications.

    As I continue this study I may pose some (hopefully meaningful) questions to the forum members. It is my understanding that the purpose of these examples is so that we the user might use them as a framework on which to develop our own specific firmware.

    Using the "generic" example as the basis, I direct attention to the "gen_desc.bas" wherein there is a lengthy block of code which defines a good many 'descriptors' only to be branched around.

    Click image for larger version

Name:	gen_desc Code Clip.jpg
Views:	28
Size:	65.2 KB
ID:	8661

    Upon looking at the device properties in Windows "Device Manager" (after the device enumerates) it appears that some of the descriptor text strings have listed in the device properties. What I don't understand is why all descriptors have been branched around in "gen_desc.bas" and yet they have showed up as one would expect in "Device Manager." These definitions do not appear in any other accompanying files in the project directory thet I can see. Are they coming from some other place on the compiler path? I have looked through all the "Includes" and can't seem to find them. Furthermore, why did the designer of the example code choose to branch around this assembly code defining the descriptors? It seems to me to be essential code.

  • #2
    Sometimes I come up with possible solutions just after hitting the "Post Reply" button.

    This time NOT- but it did make me wonder about the goings on under the hood proving that I can always learn from failure. After I sent the last message I came to wonder if defining all those descriptors in the "asm" block of the file was actually optional so I removed the jump around it by commenting out the "GOTO" and the line Label. I did a clean recompile which succeeded, burned the resulting .hex and did a test run. The 18F4550 did not enumerate this time.

    If anyone could set me straight on what may be going on here, I would really like to understand. So lines 6 and 7 were the only thing this entire file contributed to the process? It seems like they could have been defined somewhere else?

    Comment


    • #3
      What I don't understand is why all descriptors have been branched around in "gen_desc.bas"
      That's because the descriptors aren't code, they're data tables.

      It uses the old-style method of using the 'retlw' instruction to fetch the data from the program memory space.

      Comment

      Working...
      X