Follow up on the monologue, and after a day of digging through literature, I now have a slightly deeper understanding of the USB protocol. The more helpful was Microchip datasheet, within the USB section related to BDT RAM.
200h is start of USB RAM for PIC18F1xK50, 400h for 18Fx550/x455/x450.
I moved the allocations to Endpoint 3 for CDC usage:
Bit 7 of BDxSTAT states which device (SIE or CPU) owns the right to write or read into the dual ported USB RAM space, so this is what is used for the TX and RX ready flag.RXOWNED VAR BD3STATOUT.7 ; Out report Owned (OUT is PC to PIC)
TXOWNED VAR BD3STATIN.7 ; IN report Owned (IN is PIC to PC)
-------------------------------------------------------------------------------------------------------
BD3STATOUT = _USBMEMORYADDRESS + 18h ; 418h or 218h
BD3STATIN = _USBMEMORYADDRESS + 1Ch ; 41Ch or 21Ch
For some reason the compiler doesn't like the 3 in "BD3STATOUT and BD3STATIN" (Bad data type error). CONFIGURED_STATE should not differs between HID or CDC as it is not endpoint dependent.





Bookmarks