Ports
May 19, 2013, 02:38:00 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: SMF - Just Installed!
 
   Home   Help Search Login Register  
Welcome to the PORTS Forum. Please post your questions, answers, and comments relating to USB and other hardware interfaces in the appropriate forums below. - Jan
Pages: [1]
  Print  
Author Topic: USB Enumeration  (Read 845 times)
Ray
Member
***
Posts: 13


« on: August 18, 2011, 05:25:34 pm »

I have finally managed to get my PC to talk to the Microchip PIC18F4550. I have opted to code entirely in Assembler so that I fully understand what is going on under to hood.

My question relates to the enumeration process, and specifically with regards to retrieving the Configuration Descriptor.

In the book USB Complete - 2nd Edition, the process is described as retrieving the first 9 bytes of the configuration descriptor, then retrieving up to FFh bytes.

In the 4th edition extract on the website it describes the second grab as only retrieving the number of bytes designated in the descriptor.

In my case, I have found the following:
9 bytes requested, 9 bytes returned by my firmware
255 bytes requested, 34 bytes returned (as this is the size of all my relevant descriptors)
The it starts again:
9 bytes requested, 9 bytes returned by my firmware
34 bytes requested, 34 bytes returned by my firmware.

It would appear that my PC has read both of the editions of your book and is now confused as to which to implement, and opted to implement both.

Is this normal?
Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1625


WWW
« Reply #1 on: August 18, 2011, 07:46:26 pm »

>It would appear that my PC has read both of the editions of your book and is now confused as to which to implement, and opted to implement both.

Wink

The editions actually don't contradict each other, "up to 255" can mean 34.

The host can do whatever it wants. The device should just respond to the host without trying to figure out why. Sometimes multiple drivers will request a descriptor. But if you're seeing what you described one after the other, it's possible that something didn't look right to the host the first time around.

Jan

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!