Skip to content

Commit 8022477

Browse files
committed
dcd_pic: add readme
1 parent 86ad6e5 commit 8022477

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Microchip PIC Chipidea FS Driver
2+
3+
This driver adds support for Microchip PIC microcontrollers with full-speed Chipidea USB peripheral to the TinyUSB stack. It supports the following families:
4+
5+
- PIC32MX (untested)
6+
- PIC32MM
7+
- PIC32MK (untested)
8+
- PIC24FJ
9+
- PIC24EP (untested)
10+
- dsPIC33EP (untested)
11+
12+
Currently only the device mode is supported.
13+
14+
15+
## Important Notes
16+
17+
### Handling of shared VBUS & GPIO pin
18+
19+
Some PICs have the USB VBUS pin bonded with a GPIO pin in the chip package. This driver does **NOT** handle the potential conflict between the VBUS and GPIO functionalities.
20+
21+
Developers must ensure that the GPIO pin is tristated when the VBUS pin is managed by the USB peripheral in order to prevent damaging the chip.
22+
23+
This design choice allows developers the flexibility to use the GPIO functionality for controlling VBUS in device mode if desired.
24+
25+
26+
## TODO
27+
28+
### Handle USB remote wakeup timing correctly
29+
30+
The Chipidea FS IP doesn't handle the RESUME signal automatically and it must be managed in software. It needs to be asserted for exactly 10ms, and this is impossible to do without per-device support due to BSP differences. For now, a simple for-based loop is used.
31+
32+
### 8-bit PIC support
33+
34+
The 8-bit PICs also uses the Chipidea FS IP. Technically it's possible to support them as well.
35+
36+
Possible difficulties:
37+
- Memory size constraints (1KB/8KB ballpark)
38+
- A third BDT layout (now we have two)
39+
- Different compiler-specific directives
40+
- Compiler bugs if you use SDCC
41+
42+
43+
## Author
44+
[ReimuNotMoe](https://github.com/ReimuNotMoe) at SudoMaker, Ltd.
45+
46+
47+
## Credits
48+
49+
This driver is based on:
50+
- Microchip's USB driver (usb_device.c)
51+
- TinyUSB's NXP KHCI driver (dcd_khci.c)

0 commit comments

Comments
 (0)