USBSERVICE + serout2 problem


Results 1 to 40 of 52

Threaded View

  1. #34
    Join Date
    Dec 2007
    Location
    Paris
    Posts
    101

    Default

    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:

    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
    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.

    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.
    Last edited by aberco; - 13th October 2010 at 22:36.

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts