Announcement

Collapse
No announcement yet.

Daryl Taylor Interrupt Routine for K40

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Daryl Taylor Interrupt Routine for K40

    I revamped the DT_INTS-18 code to work with the new K40 chips. Great, except it only works on K40 28/40 pin processors. I attempted to revamp the original (version 3.3) code to work with ALL PIC18F processors, including the new K40 varieties. Here's my challenge, my attempt at enabling multiple PIR/PIE/IPR locations was with #IF...#ENDIF clauses. Doesn't work. I tried IF/THEN...ENDIF, worked even worse. I took the time to do the tedious data entry work, but can't get the IF/THEN/ENDIF to work. Attached is the code. Some areas to pay attention:

    - First condition is lines 61 >> 70, "If not a K40 device"
    - Second condition is lines 519 >> 525, "If 28/40 pin K40 device"
    - Third condition is lines 691 >> 694, "If 64 pin K40 device"
    - Terminates at line 937 with #ENDIF

    I'm doing this for the group, so any help would be appreciated. I learned how to configure the file for the processor I'm working on at any given time, I wanted to make it universal for everyone.

    Mike

    DT_INTS-18_3_4.pbp
    We can crack this cotton PIC'n thang!

  • #2
    I just saw your post. Tested it and found a bug lines 61-70: must use AND instead of OR:

    Code:
      #if __PROCESSOR__ != "18F24K40" and __PROCESSOR__ != "18F25K40" and _
       __PROCESSOR__ != "18F26K40" and __PROCESSOR__ != "18F27K40" and _
        __PROCESSOR__ != "18F45K40" and __PROCESSOR__ != "18F46K40" and _
         __PROCESSOR__ != "18F47K40" and __PROCESSOR__ != "18F65K40" and _
          __PROCESSOR__ != "18F66K40" and __PROCESSOR__ != "18F67K40" and _
          __PROCESSOR__ != "18LF24K40" and __PROCESSOR__ != "18LF25K40" and _
       __PROCESSOR__ != "18LF26K40" and __PROCESSOR__ != "18LF27K40" and _
        __PROCESSOR__ != "18LF45K40" and __PROCESSOR__ != "18LF46K40" and _
         __PROCESSOR__ != "18LF47K40" and __PROCESSOR__ != "18LF65K40" and _
          __PROCESSOR__ != "18LF66K40" and __PROCESSOR__ != "18LF67K40"
    TMR1_INT interrupt works well but RX2_INT doesn't. The processor jump somewhere else. See thread http://support.melabs.com/threads/11...ull=1#post3647

    Comment


    • #3
      page referred to for rx2_int fix is not available ???

      Comment


      • #4
        You may have to add features not listed. Just copy/paste the format, but alter the content to reflect Processor's SFRs. That's how we were able to get the DT_INTS working on K40's in the first place. Occasionally I have to tweak a line here or there for a new chip to do what wasn't available when the original INTS code was written. For example, I had to add Angular Timer parts for the PIC16F1619.
        We can crack this cotton PIC'n thang!

        Comment


        • #5
          Originally posted by longpole001
          page referred to for rx2_int fix is not available ???
          See http://support.melabs.com/forum/picb...-new-18f-chips

          RX2_INT does work.

          Comment

          Working...
          X
          😀
          🥰
          🤢
          😎
          😡
          👍
          👎