Menu

Enhanced midrange PIC, less optimization?

Fulvio _
2023-02-02
2023-02-03
  • Fulvio _

    Fulvio _ - 2023-02-02

    Hello everybody,
    I started compiling and I went to look the final result on the assembler code.

    The purpose was to compile for an 12F180 which should be able to use self saving register on an interrupt call, but the compiler handle as old midrange MCU.
    The addressing of strings written in program memory should be possible to use single byte, but it shown a series of RETLW char .

    I'm pleased to see a good optimization for the rest of the compiled result.

     
  • Anobium

    Anobium - 2023-02-02

    The use of RETLW is the call method we use across a number of chip families. The real person to answer this is specific question is Hugh.

    Regarding the saving of the interrupt register. I did make a major change last year but I had to revert the change as it broke other chips. See below. If we were to have another attempt at this then we would need a more robust test regime across a lot of chips. The change itslef is relatively simple... the testing failed on change 1019 and 1020 to find the side effects.

    10/05/2022  1117    Fix COMPILER "Fix: Reverting the complete method AddInterruptCode() to resolve this Family15 interrupt issue.  This also reverts K42 interrupt handler improvements.  This will increase interrupt latency but it is intended to resolve stability issues.[1355]
    Removes the following two changes.
    - 1019  NEW COMPILER    INTERUPT New: Improved interrupt latency by adding Family 15 ( 12F and 16F ) interrupt handler to use shadow locations for system variables, therefore use chips automatic context saving[1258] 
    - 1020  NEW COMPILER    INTERUPT New: Improved interrupt latency for all Family 16 ( 18F ), was just K42 chips, interrupt handler to use shadow locations for system variables, therefore use chips automatic context saving[1259] "
    
     
  • Anobium

    Anobium - 2023-02-02

    Be good to geta developer. Are you interested in helping in the development work?

     
  • Fulvio _

    Fulvio _ - 2023-02-03

    Thank you so much for your appreciation, but I have a little knowledge to accomplish such a task. Further more the capability to make a solution will imply even some hardware testing, of which I'm poorly able to keep up.

    I was almost able to do something with midrange PIC MCU. But I got to agree that family is obsoleted and should be discouraged to make any project. Then currently I looking forward to the newer MCU which even Microchip wants to promote.

    For this case, I suppose that there should be some declaration that will tell the kind of MCU that are excluded from the procedure of saving the registers. Also some other features added, in particular the enhanced mid-range, that has doubled the stack for subroutines jumps.

    But to make a bit easier for developing, just let the user to decide whether wants to use the new features, like the mentioned one. In most of the cases is not a problem the cost of some additional routine currently in use.

     
  • Anobium

    Anobium - 2023-02-03

    I like the idea of a declaration. I will look again soon as optimising the interrupt handler.

    I do not want to clutter the compiler with declarations, but, it may be required.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.