• AVR Freaks

AnsweredHot!PIC32MZ interrupts

Author
ibbro
Junior Member
  • Total Posts : 91
  • Reward points : 0
  • Joined: 2015/10/22 07:34:56
  • Location: 0
  • Status: offline
2020/01/18 11:02:59 (permalink)
5 (1)

PIC32MZ interrupts

I'm surprised that the absolute best I can get on a PIC32MZ2048EFH at 198mhz for interrupt latency is 900ns. Using IPL7AUTO I see 1us. Switching to IPL7SRS and setting the PRISS register to 0x76543210 takes it down to the 900ns. Am I missing something? Has anyone obtained faster interrupt latency times?
Thanks,
IB
post edited by ibbro - 2020/01/18 11:04:00
#1
andersm
Super Member
  • Total Posts : 2839
  • Reward points : 0
  • Joined: 2012/10/07 14:57:44
  • Location: 0
  • Status: offline
Re: PIC32MZ interrupts 2020/01/18 11:16:44 (permalink)
0
What are you measuring?
#2
ibbro
Junior Member
  • Total Posts : 91
  • Reward points : 0
  • Joined: 2015/10/22 07:34:56
  • Location: 0
  • Status: offline
Re: PIC32MZ interrupts 2020/01/18 11:20:22 (permalink)
0
I'm looking at the trailing edge of an OC9 output pulse, which triggers the interrupt and inverting a GPIO on the first line of the interrupt handler. What I'm calling latency is the time between as seen on 2 scope channels. I am using harmony 3 code as generated and their interrupt handler does a function call to mine. That is the only thing I know to improve. I'm not using a callback, I put my handler in their generated code and eliminated the callback.
 
 
post edited by ibbro - 2020/01/18 11:23:25
#3
ibbro
Junior Member
  • Total Posts : 91
  • Reward points : 0
  • Joined: 2015/10/22 07:34:56
  • Location: 0
  • Status: offline
Re: PIC32MZ interrupts 2020/01/18 11:34:56 (permalink)
0
I'm not real clear on the vector offsets for the Pic32MZ and Harmony 3. I'm thinking replacing the single calls in their interrupts.c might not work if the VOFF values in the vector table are set to small increments for each handler. Unfortunately I need Harmony for USB and ethernet and don't want to get too invasive.
 
#4
simong123
Lab Member No. 003
  • Total Posts : 1391
  • Reward points : 0
  • Joined: 2012/02/07 18:21:03
  • Location: Future Gadget Lab (UK Branch)
  • Status: offline
Re: PIC32MZ interrupts 2020/01/18 11:53:09 (permalink) ☼ Best Answerby ibbro 2020/01/18 12:41:53
5 (2)
Calling a function external to the interrupt compilation unit will force a full FPU state save.
Add the no_fpu attribute to the interrupt routine to prevent this.
#5
ibbro
Junior Member
  • Total Posts : 91
  • Reward points : 0
  • Joined: 2015/10/22 07:34:56
  • Location: 0
  • Status: offline
Re: PIC32MZ interrupts 2020/01/18 12:44:19 (permalink)
5 (1)
Adding no_fpu resulted in much better numbers. Now measuring 300ns. Thanks simong123.
#6
Jump to:
© 2020 APG vNext Commercial Version 4.5