+ Reply to Thread
Results 1 to 19 of 19
  1. #1
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,106

    Default Error when compiling with DT_INTS_3_4b"

    I have been using the modified DT_INTS_3_4b for some time but, now when I try to use LOW PRIORITY interrupts I get the following ASM ERROR's:
    : Illegal character (=)
    : Symbol not previously defined (K40 family)

    I have been using the 18F27K40 and have now tried to use the 18F47K40 with LOW PRIORITY interrupts.

    Code excerpts in order are below:

    INCLUDE "C:\PBP\INCLUDES\DT_INTS-18_3_4b.bas" ' Interrupt Control routines
    INCLUDE "C:\PBP\INCLUDES\ReEnterPBP-18.bas" ' Interrupt Control routines
    INCLUDE "C:\PBP\INCLUDES\ReEnterPBP-18LP.bas" ; Include if using Low Pr. PBP INTS

    DEFINE OSC 64
    DEFINE USE_LOWPRIORITY 1

    asm
    ;----[High Priority Interrupts]-----------------------------------------------
    INT_LIST macro ; IntSource, Label, Type, ResetFlag?
    ;LINEAR or ROTARY ENCODER INPUT - A (INCREMENT POSITION)
    INT_Handler INT0_INT, _INC_C, PBP, yes
    ;LINEAR or ROTARY ENCODER INPUT - B (DECREMENT POSITION)
    INT_Handler INT1_INT, _DEC_C, PBP, yes
    endm
    INT_CREATE ; Creates the High Priority interrupt processor

    ;----[Low Priority Interrupts]------------------------------------------------
    INT_LIST_L macro ; IntSource, Label, Type, ResetFlag?
    INT_Handler TX1_INT, _UARTTX1, PBP, no
    INT_Handler RX1_INT, _UARTRX1, PBP, no
    INT_Handler TX2_INT, _UARTTX2, PBP, no
    INT_Handler RX2_INT, _UARTRX2, PBP, no
    INT_Handler TMR1_INT, _TIMR1, PBP, yes
    endm
    INT_CREATE_L ; Creates the LOW Priority interrupt processor
    ENDASM

    This coding works perfectly with an 18F26K22 and 18F46K22 before changing to DT_INTS18_3_4b.



    Any help would be appreciated...
    Dave Purola,
    N8NTA
    EN82fn

  2. #2

    Default Re: Error when compiling with DT_INTS_3_4b"

    Dave,

    Seems that there were a few mistakes when the low priority interrupts were defined. Try this new version (3.4c) and see if it works out.
    It compiled ok using the test code below, but I didn't try actually running it
    Code:
    '18F27K40
    DEFINE OSC 64
    DEFINE USE_LOWPRIORITY 1
    
    INCLUDE "DT_INTS-18_3_4c.bas" ' Interrupt Control routines
    INCLUDE "ReEnterPBP-18.bas"      ' Interrupt Control routines
    INCLUDE "ReEnterPBP-18LP.bas"   ' Include if using Low Pr. PBP INTS
    
    GIEH    VAR INTCON.7        ' high priority interrupts
    GIEL    VAR INTCON.6        ' low priority interrupts
    
    asm
    ;----[High Priority Interrupts]-----------------------------------------------
    INT_LIST macro ; IntSource, Label, Type, ResetFlag?
        ;LINEAR or ROTARY ENCODER INPUT - A (INCREMENT POSITION)
        INT_Handler INT0_INT, _INC_C, PBP, yes
        ;LINEAR or ROTARY ENCODER INPUT - B (DECREMENT POSITION)
        INT_Handler INT1_INT, _DEC_C, PBP, yes
     endm
        INT_CREATE ; Creates the High Priority interrupt processor
    
    ;----[Low Priority Interrupts]------------------------------------------------
    INT_LIST_L macro ; IntSource, Label, Type, ResetFlag?
        INT_Handler TX1_INT, _UARTTX1, PBP, no
        INT_Handler RX1_INT, _UARTRX1, PBP, no
        INT_Handler TX2_INT, _UARTTX2, PBP, no
        INT_Handler RX2_INT, _UARTRX2, PBP, no
        INT_Handler TMR1_INT, _TIMER1, PBP, yes
     endm
        INT_CREATE_L ; Creates the LOW Priority interrupt processor
    ENDASM
    
    goto OverIntHandlers
    
    INC_C:
    @ INT_RETURN
    
    DEC_C:
    @ INT_RETURN
    
    UARTTX1:
    @ INT_RETURN
    
    UARTRX1:
    @ INT_RETURN
    
    UARTTX2:
    @ INT_RETURN
    
    UARTRX2:
    @ INT_RETURN
    
    TIMER1:
    @ INT_RETURN
    
    OverIntHandlers:
    
    '----[ Interrupt control ]-------------------------------------------------------
    main:
    NOP
    GIEL = 1     ' Enable low priority interrupts
    GIEH = 1     ' Enable global interrupts
    Attached Files Attached Files

  3. #3
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,106

    Default Re: Error when compiling with DT_INTS_3_4b"

    Tumbleweed, It works a treat. Thanks... Wow these K40's can really be a pain but, twice the memory. I only wish my UMC Loader worked with them...
    Last edited by Dave; - 20th May 2018 at 16:40.
    Dave Purola,
    N8NTA
    EN82fn

  4. #4

    Default Re: Error when compiling with DT_INTS_3_4b"

    Great. Glad it's working.

    I only wish my UMC Loader worked with them...
    I've got a 27K40 floating around here someplace. When I get a chance I'll see if I can get a UMC build together that works with it.

  5. #5
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,106

    Default Re: Error when compiling with DT_INTS_3_4b"

    I believe the problem is with the UMCBuild.exe file that needs to be changed. I have tried a few times with the config's set for the appropriate devices and all I get is the message "Device not Self Programmable". I have emailed David Barker and he said that he will not support new devices for that Bootloader any more.
    Dave Purola,
    N8NTA
    EN82fn

  6. #6

    Default Re: Error when compiling with DT_INTS_3_4b"

    UMCBuild.exe requires mpasm and some of the files from the old MPLAB8, but you need mpasmx from MPLABX to support the K40. Add to that it's possible MPLABX no longer includes some of the files UMCBuild is looking for.

    I'm pretty sure I can knock something together for you... I just need some free time to look at it.

  7. #7

    Default Re: Error when compiling with DT_INTS_3_4b"

    Well, it turned out that there are so many changes required to get umcbuild to use mpasmx it just wasn't worth the bother.

    Here's the asm source for a UMC loader that works with the K40 (at least the 27K40... the only one I tried).
    You'll have to change the entries in the USER CONFIGURATION SECTION to match what you're using.
    Right now it's setup for an 18F27K40, 16MHz intosc, and uart1 on RC6/RC7.

    There are no other files required except for the mpasmx p18FxxK40.inc file. Don't use umcbuild.exe... just assemble it with mpasmx
    Attached Files Attached Files

  8. #8
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,106

    Default Re: Error when compiling with DT_INTS_3_4b"

    Thanks Tumbleweed, I will give it a try when I get home from work tonight and let you know.
    Dave Purola,
    N8NTA
    EN82fn

  9. #9
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,106

    Default Re: Error when compiling with DT_INTS_3_4b"

    Well Tumbleweed, I just couldn't wait to try it out. It all looks good. The only error I got when compiling was "undefined symbol":

    ; check to make sure program fits 26-5-2018
    #if $ > DEVICE_ROM
    error "program code exceeds flash size. change LOADER_SIZE_MIN"
    #endif

    I just commented them out and away we go....

    Once again, Thanks for the mod's.
    Last edited by Dave; - 30th May 2018 at 15:14.
    Dave Purola,
    N8NTA
    EN82fn

  10. #10

    Default Re: Error when compiling with DT_INTS_3_4b"

    The only error I got when compiling was "undefined symbol":
    That's odd... I don't get that.

    That size check is there to make sure the loader doesn't grow bigger than what's reserved (this one's a bit larger at 512 bytes vs 384).
    What version of mpasmx are you using? I was using 5.77

  11. #11
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,106

    Default Re: Error when compiling with DT_INTS_3_4b"

    It says, V5.778 in the toolchain. I did notice and have worked on trying to get the bootloader to work with usart2 with no success. I don't understand why?
    I have attached the modified version. Maybe if you can, take a look?
    Attached Files Attached Files
    Dave Purola,
    N8NTA
    EN82fn

  12. #12

    Default Re: Error when compiling with DT_INTS_3_4b"

    All of the control registers for UART1 are in the access bank so you can get away with not using banksel to get to them.
    UART2 registers are in a different bank (bank 14, 0x0E99-0x0E9F) so you have to load the BSR (ie BANKSEL RC2STA) to access them.

    You can still use UART1 but assign it to different pins with the PPS... that would be a lot easier (and smaller) than adding all the code to get at UART2.

  13. #13
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,106

    Default Re: Error when compiling with DT_INTS_3_4b"

    Tumbleweed, I think I will go the ( BANKSEL RC2STA) route because I use the uart1 for different communications to remote arrays. Thanks for the advice, I should have seen that. I am by no means an asm guru but I do know enough to get into trouble.....
    Dave Purola,
    N8NTA
    EN82fn

  14. #14
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,106

    Default Re: Error when compiling with DT_INTS_3_4b"

    Well, This has been a prosperous morning as I have the bootloader running on com2. For this project I need to bootload it over Bluetooth. Thanks so much Tumbleweed for the advice. I can see a whole new future with these K40's.... Thanks...
    Dave Purola,
    N8NTA
    EN82fn

  15. #15
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    765

    Default Re: Error when compiling with DT_INTS_3_4b"

    hi DAVE

    i am also getting some compile errors , that not sure why ,

    using DT_INTS-18_34c for the 18F24K40 , no priority is used

    Code:
    
      ' ---------- Set up DT_INTS-18 Routine for Instant Interupt handling   -----------
       
         INCLUDE "DT_INTS-18_K40.bas"   ; Base Interrupt System for 18FxxK40 processors  ( DT_INTS-18_3_4C.BAS)
         INCLUDE "ReEnterPBP-18.bas"    ; Include if using PBP interrupts
    
    ASM
    INT_LIST macro; IntSource,  Label     , Type, ResetFlag?
       INT_Handler TMR0_INT, _Timer0_Count,  PBP, yes      ; call Timer0_Count subroutine
       INT_Handler  IOC_INT, _Rx_mode_IOC ,  PBP, yes      ; Call Rx_mode_IOC subroutine for RF RX_mode
       INT_Handler  RX2_INT, _Term_RX     ,  PBP, yes      ; Call Term_input for terminal char buffer 
     endm
     INT_CREATE								; Creates the Interrupt Processor
    ENDASM
    
     
    --------------------------------------
    
    
     '---------- Start of Program commands ---------------
    Gate_Reset:                  ' Label for a soft reset 
      Clear                      ' Clear varables    
    @ INT_ENABLE TMR0_INT        ; enable Timer0 interupts and start Timer0   
    @ INT_ENABLE  IOC_INT        ; Enable PortB IOC Interrupts for RX_mode  - RF_IRQ pin







    following compile errors are

    Code:
     problem - Symbol not previously defined (intflagbit)
     problem - Symbol not previously defined (intflagreg)
    
    ; -- macro --
    INT_Source  macro  IFR, IFB, IER, IEB, IPR, IPB
        if (IflagReg == IFR) && (IflagBit == IFB)  
      list

    Code:
    error  "INT_ENABLE - Interrupt Source not found!"

  16. #16
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    765

    Default Re: Error when compiling with DT_INTS_3_4b"

    ok found the problem

    an include that is common to the project uses enable /disable RBC_INT , which does not exist on the 27k40

    hows ever i need to enable/disable RBC_INT when its 46k80 but when its 27k40 use enable/ disable IOC_INT
    and want both in the include file

    can someone show an example advise how this is done cos i never had to do before

  17. #17
    Join Date
    May 2013
    Location
    australia
    Posts
    1,465

    Default Re: Error when compiling with DT_INTS_3_4b"

    4.12 in manual

    #IF __PROCESSOR__ = "16F877"
    ADCON1 = 7 'All pins digital on the 877A
    #ELSE
    ANSEL = 0 'AN0-AN7 digital on the 887
    ANSELH = 0 'AN8-AN13 digital on the 887
    #ENDIF
    This is more entertaining than Free to Air TV

  18. #18
    Join Date
    Apr 2014
    Location
    Northeast
    Posts
    233

    Default Re: Error when compiling with DT_INTS_3_4b"

    This or some variation may work. I borrowed & modified it from working code.

    Code:
    ASM
    #if __PROCESSOR__ = "18F27K40" or __PROCESSOR__ = "18F47K40" 
    
    #define IOC_INT
    
    #else
        #if __PROCESSOR__ = "18F46K80"
    
    #define RBC_INT
    #endif
    ENDASM

  19. #19
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    765

    Default Re: Error when compiling with DT_INTS_3_4b"

    thanks guys

Similar Threads

  1. Replies: 0
    Last Post: - 14th November 2013, 03:32
  2. Error while compiling
    By BobK in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th April 2013, 17:01
  3. Replies: 1
    Last Post: - 30th March 2012, 04:13
  4. Compile error & syntax error on the word "loop:" as a label?
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 7th March 2010, 04:14
  5. error on compiling
    By parker in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 16th June 2005, 14:31

Members who have read this thread : 22

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