PIC18F46J50 Interrupts with bootloader and application

(instructions, reset, WDT, specifications...) PIC17Cxx, PIC18Fxxx

PIC18F46J50 Interrupts with bootloader and application

Postby UnicycleBloke » Thu Apr 08, 2021 1:49 pm

I am an experienced developer, mostly Cortex-M devices, but this is my first time with PICs.

I've implemented a UART driver for the application which uses interrupts. This is for comms with another processor in the system - an ARM. I now need to think about the bootloader for the PIC. The ARM will send commands to the PIC bootloader to write a new image for the application. It would be great to use the same UART driver for this but there is an issue with sharing interrupts between the two bits of firmware. I have a couple of ideas, but would be grateful for any guidance on the best way to resolve this:

1. I could use a modified version of the driver which polls rather than use interrupts - it'll work but seems unattractive.
2. I could make the driver uses the low priority interrupt in the bootloader, and high one in the application, and forward only the high priority interrupt in the vector table - sounds OK but will it work like I think?

I'm using a number of other interrupts in the application, but they all have the same priority.

Thanks.
UnicycleBloke
 
Posts: 1
Joined: Thu Apr 08, 2021 1:30 pm

Re: PIC18F46J50 Interrupts with bootloader and application

Postby ric » Thu Apr 15, 2021 12:29 pm

1. I could use a modified version of the driver which polls rather than use interrupts - it'll work but seems unattractive.

This is the easiest way to do it.
The bootloader has just one job, so polled serial usually isn't a problem.
Everyone hopes to share code between bootloader and application, but that usually adds way too many problems.
Latest test project, an LED matrix display made from one reel of addressable LEDs. here
User avatar
ric
Verified identity
 
Posts: 659
Joined: Sat May 24, 2014 2:35 pm
Location: Melbourne, Australia
PIC experience: Professional 5+ years with MCHP products

Re: PIC18F46J50 Interrupts with bootloader and application

Postby joannsabki » Thu Sep 09, 2021 10:01 am

It must be very cool to be a developer of various programs and applications. I sincerely believe that really very smart people are capable of this and, in principle, can understand all this. I've always dreamed of working in this field, but I didn't have the talent for such things. The only thing that I am good at doing is downloading ready-made applications. Just yesterday, I downloaded a window manager for my MacBook and admired the people who came up with it.
I wish you good luck in your work and more imagination. I hope you will find the solution to the problem that you are looking for.

__________________________________
okaapps.com
Last edited by joannsabki on Sun Sep 12, 2021 3:16 pm, edited 1 time in total.
User avatar
joannsabki
 
Posts: 1
Joined: Thu Sep 09, 2021 9:56 am

Re: PIC18F46J50 Interrupts with bootloader and application

Postby ric » Thu Sep 09, 2021 10:40 am

joannsabki wrote:That way won't work for me.

We can't offer much help if you don't explain why it won't work for you.
Latest test project, an LED matrix display made from one reel of addressable LEDs. here
User avatar
ric
Verified identity
 
Posts: 659
Joined: Sat May 24, 2014 2:35 pm
Location: Melbourne, Australia
PIC experience: Professional 5+ years with MCHP products


Return to 16-Bit Core

Who is online

Users browsing this forum: No registered users and 11 guests

cron