Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

  1. #1
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Darrel

    I'm going to be moving a project from a 16F88 to an 18F1320. The reason for the move is the 18F1320 has 3 external interrupts, 2 of which I will be using. Currently I'm using instant interrupts and INT_INT on the 16F88. The question is will instant interrupts work with multiple external interrupts? I see in the datasheet that the external interrupts have numbered flags.

  2. #2
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DynamoBen
    Darrel

    I'm going to be moving a project from a 16F88 to an 18F1320. The reason for the move is the 18F1320 has 3 external interrupts, 2 of which I will be using. Currently I'm using instant interrupts and INT_INT on the 16F88. The question is will instant interrupts work with multiple external interrupts? I see in the datasheet that the external interrupts have numbered flags.
    See http://darreltaylor.com/DT_INTS-18/home.html. Darrel has done a good job documenting the Instant Interrupts, and it shows on the right side of the page that multiple external interrupts are implemented.

    Steve

  3. #3
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Thanks Steve, I forgot that he was using a separate version for the 18Fs.

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Its now 7:34 am, I just read this thread from start to finish, I would like to say it went completely over my head but some must have aimed a bit lower as I now have one hell of an headache........

    I read it as I have just got a shiny new programmer and a 18f2550, I was looking for ways to port some old f88 stuff I wrote that used serial comunication, I want to it to use usb...

    I found that they are some examples to make the 2550 emulate a serial port, and I may go that way, seems easier to port that way.

    Then I read more and got more ambitious, and was wondering if I can port it over with the 2550 running fake serial over usb, but drop a bootloader in it before my old f88 code and use the bootloader over usb, then I wont need to use my pc serial port at all?


    To summise, can I re-burn the chip via usb with a boot loader to debug my ported f88 code?

    If I can, am I right in thinking all I need is to give up one i/o line to a switch to trigger the bootloader?

    And like most things come in three's (especially questions), how to edit/burn to usb? with the f88 I usually create a hex file, quit basic, load the programmer software (winpic/whatever) and burn chip, remove from programmer, get a pin stuck in thumb and lose blood, stick in proto board, bend a pin etc...

  5. #5
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default

    Lez, you might want to check the USB forum for that information.

    Robert
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Demon
    Lez, you might want to check the USB forum for that information.

    Robert
    Either I'm really dumb today (I blame last night) or their is no usb sub forum etc on here!

    found a few threads, gave me some stuff to read and I'm about ready to try and knock up a pcb to test the chip with, then i'll have a go with the mouse circle hid to test wiring, then throw in the serial demo and expand on that, thanks.
    Last edited by Demon; - 4th October 2016 at 19:42.

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


    Did you find this post helpful? Yes | No

    Default

    Here's the USB forum
    http://www.picbasic.co.uk/forum/forumdisplay.php?f=18

    Must have been a Good Night
    <br>
    DT

  8. #8
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DynamoBen
    Darrel

    I'm going to be moving a project from a 16F88 to an 18F1320. The reason for the move is the 18F1320 has 3 external interrupts, 2 of which I will be using. Currently I'm using instant interrupts and INT_INT on the 16F88. The question is will instant interrupts work with multiple external interrupts? I see in the datasheet that the external interrupts have numbered flags.

    Maybe assigning high & low priorities might help you:
    http://darreltaylor.com/DT_INTS-18/LowPriority.html

    One problem I am having now is that an internal interrupt (USB Service) seems to lose connection after I use an external interrupt (incoming USART data). Assigning a priority to each is just what I'm about to test and see how things go.

    Robert
    Last edited by Demon; - 15th August 2006 at 05:22.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

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


    Did you find this post helpful? Yes | No

    Default

    Sounds like a good idea.

    Since an HSERIN can take up to several hundred milliseconds (depending on baud rate and data size), it's best to have HSERIN in a Low Priority handler.

    And things that "must" go without fail, in the High Priorities.

    DT

  10. #10
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default

    Yup, that's what I was thinking, having the USB SERVICE come first, and have the USART interrupt 'whenever'.

    Edit: WEEE !!!

    Robert
    Last edited by Demon; - 15th August 2006 at 05:22.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  11. #11
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default

    Darrel,

    How about this one? I have one interrupt to generate a USB Service, that part works fine. I'd like to add another interrupt for USB reception, is that what USB_INT is for?

    Here is a snip of code:


    Code:
    ;----[High Priority Interrupts]-----------------------------------------------
    ASM
    INT_LIST  macro    ; IntSource,        Label,      Type, ResetFlag?
            INT_Handler   TMR1_INT,  _ServiceUSB,    PBP,  yes
            INT_Handler   USB_INT,    _ReceiveUSB,   PBP,  yes
        endm
        INT_CREATE               ; Creates the High priority interrupt processor
    ENDASM
    
    '---[USB - interrupt handler]------------------------------------------------
    ReceiveUSB:
       @ INT_DISABLE TMR1_INT   ; disable USB service interrupt
       USBBufferCount = USBBufferSizeRX 
    DoUSBIn:
       USBservice ; Generate USB Service manually
       USBIn 1, USBBuffer, USBBufferCount, DoUSBIn
       varUsbIn = conByteHigh  ' Set flag data has arrived
    @ INT_ENABLE  TMR1_INT   ; enable USB Service interrupts
    @ INT_RETURN
    
    '---[TMR1 - interrupt handler]--------------------------------------------------
    ServiceUSB:
        USBservice
    @ INT_RETURN
    Does that make sense? Or can I leave the USB Service interrupt enabled throughout the USB Reception interrupt?

    Robert
    Last edited by Darrel Taylor; - 15th August 2006 at 08:45. Reason: added [code][/code] tags
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  12. #12
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    almost 3 Am here.. it sounds good to me BUT i'll suggest to remove the USBSERVICE in the INT handler... m i'm sure i miss something anyway...
    Last edited by mister_e; - 15th August 2006 at 09:04.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e
    almost 3 Am here..
    See there, you're always ahead of me. Was only midnight here.

    DT

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


    Did you find this post helpful? Yes | No

    Default

    Well, I don't really know.

    But, the datasheet for the 18F4550 shows 12 different interrupts from the USB module that all funnel into the single USB_INT. So I doubt it's that easy.

    But if I were going to try it, I might set the ...

    TRNIE: Transaction Complete Interrupt Enable bit

    and see what happens.

    DT

    Added: and then all the others just to be sure.

  15. #15
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor
    Well, I don't really know.

    But, the datasheet for the 18F4550 shows 12 different interrupts from the USB module that all funnel into the single USB_INT. So I doubt it's that easy.

    But if I were going to try it, I might set the ...

    TRNIE: Transaction Complete Interrupt Enable bit

    and see what happens.

    DT

    Added: and then all the others just to be sure.

    WHAT DO YOU MEAN "You don't know?"


    Hmmm, I would tend to believe that flag does not distinguish between upload and download transactions; I really need a PC-to-PIC complete flag.

    Well, since I have an interrupt controlling user input on the PIC, I can just loop the PC-to-PIC USB routine. This will make things much easier to manage, I'm not very fond of using that all-encompassing USB_INT interrupt.

    Now if I can only find out why Windows won't recognize the device, things would be peachy:
    http://www.picbasic.co.uk/forum/show...8&postcount=55

    Robert
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Similar Threads

  1. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 22:43
  2. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 21:02
  3. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 21:48
  4. Keypad and DT's Instant Interrupts
    By Homerclese in forum General
    Replies: 11
    Last Post: - 27th April 2007, 07:32
  5. Replies: 1
    Last Post: - 1st November 2006, 04:11

Members who have read this thread : 6

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

Tags for this Thread

Posting Permissions

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