USBSERVICE + serout2 problem


Closed Thread
Results 1 to 40 of 52

Hybrid View

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

    Default

    I'm running PBP 2.60 in MCS 4.0.0.0, in conjunction with MPLAB 8.53.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    Some things have changed with PBP 2.6. Maybe that is the problem?
    Have you seen this?
    http://www.picbasic.co.uk/forum/show...0301#post80301
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Dec 2007
    Location
    Paris
    Posts
    101

    Default

    Yes I know this post was my starting point.

    Copy the PBP\USB18 folder to a new location.
    You do not want any files left over from previous versions of PBP, so don't try to copy it into an existing project folder.

    Open and compile cdc_demo.bas with the proper chip selected.
    Program the chip and test. Done deal.
    That is exactly what I did, and it does work.

    It is when I add Darrel USB_ASM_Service.pbp and remove the original USBINIT/USBSERVICE that the PIC does not enumerate anymore...

    A last resort idea would be to USBSERVICE using a Timer0 interrupt, but Darrel solution adds more fancy controls such as the ability to know if the link is established, or if Tx/Rx operations are available/possible. This would be a nice addition to prevent any USB buffer fill and lock-up of the PIC.

    (PS. I tried to send a private message to Darrel about 3 weeks ago but had no reply).
    Last edited by aberco; - 16th September 2010 at 16:56.

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    Darrel has been out of town. He is sorta back now so maybe he will be able to help now.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Dec 2007
    Location
    Paris
    Posts
    101

    Default

    Ok, I tried some debug attempt with some LED blink, which show me that the interrupt handler "DoUSBSERVICE" within Darrel's routine is not called.

    This is what should do the USBSERVICE. Is there something to do to link this handler to an interrupt? should I configure a timer for this? I have deactivated the watchdog timer if that could explain why the handler is not working...
    I do not understand what triggers this interrupt. I've tried to call it manually within the USBIN loop using a GOSUB, but that does not help getting the PIC to enumerate...
    Last edited by aberco; - 16th September 2010 at 21:54.

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    Aberco,

    Sorry, I deleted your modification because it was silly to use Timer0 for USB interrupts, and it won't detect Plugged, RX, or TX, that way.
    Plus I don't want that code floating around.
    Some Patience is required until I get settled. I don't have any computers or internet access at night right now.

    I believe that all you need to do is change the USBIE and USBIF bits because Microchip moved them in the 13K50/14K50.
    They used to be PIE2.5 and PIR2.5 in the 4550 family. Now they are PIE2.2 and PIR2.2 in those chips.

    Please download the file again to start from scratch, then change to ...

    Code:
    USBIE              VAR PIE2.2        ; USB funnel Interrupt Enable
    USBIF              VAR PIR2.2        ; USB Interrupt Flag
    DT

  7. #7
    Join Date
    Dec 2007
    Location
    Paris
    Posts
    101

    Default

    Simple enough, and worked great!

    May I ask what drives the USBSERVICE interrupt?
    Also I would like to use DT_INTS-18.bas in the program as well but I don't understand how to use the interrupt hook handler, and could not find any example of it.

    Take your time, there's no hurry, I can now spend some time to play with USB data transmission

    Thanks a lot for the great help.

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