USBSERVICE + serout2 problem


Closed Thread
Results 1 to 40 of 52

Hybrid View

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

  2. #2
    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 22:54.

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

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

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

    Default

    Or... is there a way to turn DT_HID260 into a DT_CDC260? is there something I could use in the cdc_desc.bas file (contained in the USB demo folder) to do such thing or is it more complicated than transferring a series of values?

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

    Default

    > May I ask what drives the USBSERVICE interrupt?
    The USB module itself generates many different interrupts.

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

    That is not possible with USB_ASM_Service.pbp.
    All interrupts used with the "Hook" can only be ASM (assembly language) type interrupts.

    > Or... is there a way to turn DT_HID260 into a DT_CDC260?
    No, but I could write a DT_CDC program. If I ever get my computers and internet access at home.
    DT

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

    Default

    Ok, that was my understanding of the interrupt hook handler. Hmmm that will make things more difficult. A DT_CDC would be extremely helpful in my case, but that is a lot to ask...

    I will think about it, currently I have two different application, both that need to use the CDC profile (HID could work, but that would make programming more difficult on the computer side... also it is nice to use a terminal to drive the device without any dedicated software).
    One application needs Timer1 to do precise timing sampling, the second needs your multiple software PWM routine to drive 3 LEDs.

Members who have read this thread : 2

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