December 7, 2020

USB - Pins, GPIO, and alternate function.

The trick now is to get the two pins that are connected to the USB connector to be controlled by the USB rather than the GPIO. A look at the schematic tells me which GPIO pins these are.
PA11 is D-
PA12 is D+
Table 9 in the datasheet (not the reference manual) tells us that AF setting 10 gives us USB function for these pins.

Now we go to the GPIO section of the reference manual. A nice thing about the F411 as compared to the F103 is that there is no AFIO gadget, it is all managed as part of the GPIO. We set the mode bits to get AF, and then the output type to push pull and hopefully this will work.


Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org