I am trying to use USB stack 1.4.0 on KL26 mounted in our board. I have a problem concerning USB OTG peripheral .
I can't understand compeltely how the peripheral works.
First of all in KL26 RM (section 35.4.7), for the OTG STAT register (USB0_OTGSTAT), it’s stated that it “Displays the actual value from the external comparator outputs of the ID pin and VBUS” , which comparator is referring to ?
It seems that the USB ID signal has to be fed into a comparator for ID detection by USB peripheral. Can you explain in more details which comparator is here meant ?
Moreover is that register a read-only one ?
Again regarding the USB ID detection, in section 35.4.5, regarding OTG Interrupt Status register description, it is stated that the USB controller can generate an interrupt when it detects that ID signal change. I can’t find such an input in the OTG peripheral as described in the reference manual.
Thanks you very much!
Unfortunately, the manual isn't very clear on this right now. We are working to clean up the descriptions for the OTG registers, but those changes are only in a couple of manuals so far like K80:
The bits you are asking about exist within the USB controller itself; however, the way the module is integrated on Kinetis products most of those bits aren't actually hooked up to anything. If you refer to section 52.1.3 in the K80 RM I linked to above, you'll find our recommendations on how to handle VBUS and ID pin detection.
I hope this information helps. My apologies about the confusion caused by the manual, but we are working to improve it.