Easy HID Command -Response application


Closed Thread
Results 1 to 26 of 26

Hybrid View

  1. #1
    Join Date
    Dec 2006
    Posts
    32

    Default

    Hi guys,

    Quick question to Darrel if you see this thread

    Im using the USB_ASM_Service interupts which runs perfect for keeping my USB connection alive (as not using it with using LCDOUT in my main loop where no matter what I tried it killed the USB link even when I used your instant interupt 18 file.)
    Now I need to use the HPWM and found the info referring to setting the new duty cycle which works, but what im having problems with is this:

    I need to adjust the duty cycle based on user settings etc and updating the duty cycle in the main loop is way to slow (LCDOUT pauses slow the main loop down to much) so I added it as a hook using your INT_HOOK but I realised that the interupt only fires when the USB is plugged in (seems pretty obvious really as thats what the USB service file was created for lol) but I need it running all the time and have tried to insert your instant interupts again into the project, and after commenting out 2 lines which were in both files of yours, it assembles fine but when squirted into the pic and run it just hangs.

    I was just wondering if you have any tips on using both your instant interupts and the USB service interupt file.

    i'll keep plodding on with it in case I manage to work it out myself, but any info would be appreciated.


    Update:

    Ive managed to get the USB working by commenting out the:
    Code:
     DEFINE INTHAND _DoUSBSERVICE
    in the USB ASM Service file and adding it to here
    Code:
    asm
    INT_LIST  macro  ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler     USB_INT,     _DoUSBSERVICE, PBP, yes
            INT_Handler     INT_INT,     _MyPWM,   PBP,  yes
        endm
        INT_CREATE             ; Creates the Low Priority interrupt processor
    ENDASM
    
    @    INT_ENABLE  INT_INT
    And it works fine BUT this is where im really getting lost. (Noticed that because its enabled in the USB ASM service file, I dont need to add it using the INT_ENABLE command.)
    IF I set my interupt (the _MyPWM) to INT_INT it sends the LCD screen nuts BUT I can sort of see the counter im testing with changing, but when I try any other interupts it just sits there (Tried TMR0_INT and a fair few others with no luck as they either dont run the interupt or the LCD screen gets garbled)

    Will keep plodding on and hopefully work out whats wrong.
    Last edited by Mark J; - 22nd September 2010 at 15:19.

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

    Default

    I'm in the same boat... it is possible to use Darrel interrupt routines with his new USB HID package, DT_HID260. It sort of replaces the USB_ASM_Service routine, and is very well designed.
    Would love to do the same with CDC profile
    Last edited by aberco; - 22nd September 2010 at 15:30.

  3. #3
    Join Date
    Dec 2006
    Posts
    32

    Default

    Quote Originally Posted by aberco View Post
    I'm in the same boat... it is possible to use Darrel interrupt routines with his new USB HID package, DT_HID260.
    Would love to do the same with CDC profile
    Hmm. Will have to look at the DT_HID as remember seeing it previously and completely forgot about it. Fingers crossed it'll sort some problems out etc.

  4. #4
    Join Date
    Dec 2006
    Posts
    32

    Default

    Phew, after a bit of headscratching ive got the DT_HID working with the DT_INTS-18 after having a bit of a fight with just getting the USB to recognise first (guess who used CLEAR in the wrong place LOL!!! )

    Once I had the USB recognised, I simple added my own interupt as per usual with the INTS-18 and it worked.

    One side effect with this is that in my main loop where the test counter i displayed was slow as it added 1 each cycle of the main loop is now racing along at a hell of a a faster rate wheras before it counted up at almost 1 per second. Not complaining though lol! as if this has kicked everything up a gear thats fine by me!

  5. #5
    Join Date
    Dec 2006
    Posts
    32

    Default

    Additional note to my post above on the super speed increase!

    Just gone back to my project and noticed that I ONLY get the super speedy respones WHEN then USB cable is plugged in! as soon as I remove it you can see the counters on the LCD drop to an almost crawl on the updates so im now completely confused!

Similar Threads

  1. USB hid maker help please.
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd April 2013, 15:49
  2. i cant get 18f2550 work as HID
    By Ahmadabuomar in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 13th October 2009, 17:39
  3. Unusual Interrupts Application Problem
    By Joe Rocci in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th May 2009, 12:55
  4. Hid Maker FS Problems
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 24th April 2009, 22:27
  5. Making your own HID descriptor file
    By NL2TTL in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 27th April 2005, 13:35

Members who have read this thread : 0

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