News:

;) This forum is the property of Proton software developers

Main Menu

Using interrupts on the Pic18F27Q43

Started by TimB, Jun 30, 2022, 08:17 PM

Previous topic - Next topic

TimB


Me and Gabi are starting to play with the Pic18F27Q43 its the device on the Microchip Evaluation Kit Microcontroller Evaluation Kit

Now the issue is the interrupts. It seems to implement a new interrupt handler using vectors as well as the old system and uses an option with the MVECEN in the config reg to swap

My question is will proton handle it either way i.e using the vectored interrupt system or the old way with High and low interrupts?

The code is being transferred from an old device so happy with the old system but it does not seem to work.

Any help appreciated.....


Tim

top204

#1
Until I have the time to get my head around the vectored interrupts on the newer 18F devices, the compiler uses the standard interrupts.

This is because they will need a new Context Save/Restore mechanism implemented in the compiler for them, and a new Isr mechanism with multiple names etc, and a full re-write of the compiler's interrupts mechanism will be required, as I had to do with the PIC24 and dsPIC33 devices that have vectored interrupts. Hardware based vectored interrupts are actually quite wasteful of both flash memory and RAM, but the PIC24 devices have a true RAM stack, so the contexts get pushed/popped in it for each interrupt in operation, but the 8-bit devices do not, and it will take RAM that cannot be re-used because it is never known when it is being used. But, once I get my head around them, I am sure I will come up with an efficient method of using them. :-)

You can implement your own vectored interrupt mechanism on any 18F device, as I have done with the 18F27K42 device, and the compiler has full control of it, and it works well. The new 4.0.2.0 update has it in the "Includes" folder: "C:\Users\Les\PDS\Includes\" and it is named: "Positron Int Manager.inc". To alter it for another device, go into the device's datasheet and the device's .def file and add/remove the interrupts that the device is capable of and not capable of to the file, and change the SFRs and bits that need changing for that particular device.

It works extremely well and if very flexible in operation.

If you go in the "Amicus18_Board" section of the "Samples" folder: "C:\Users\User Name\PDS\Samples\Amicus18_Board\Interrupt_Manager\", you will see the interrupt manager I originally created for the PIC18F25K20 device back in about 2011 and a couple of demos for it.

TimB