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