• AVR Freaks

Helpful ReplyHot!MPLAB Device Blocks for Simulink 2019

Author
Sobottech
Super Member
  • Total Posts : 254
  • Reward points : 0
  • Joined: 2015/12/02 03:32:17
  • Location: 0
  • Status: offline
2019/05/09 02:26:19 (permalink)
0

MPLAB Device Blocks for Simulink 2019

Hm,
 
where to get the file. The links are wrong or files got deleted...
What about a new version?
#1
f.stojanovic
New Member
  • Total Posts : 18
  • Reward points : 0
  • Joined: 2019/05/07 01:56:09
  • Location: 0
  • Status: offline
Re: MPLAB Device Blocks for Simulink 2019 2019/05/09 05:47:28 (permalink)
0
I was wondering too. They seem to have disappeared, the developer, L. Kerhuel, is fairly active here, he might be able to guide us at this point.
#2
Lubin
Moderator
  • Total Posts : 373
  • Reward points : 5
  • Joined: 2007/03/31 07:38:15
  • Location: Bayonne, France
  • Status: offline
Re: MPLAB Device Blocks for Simulink 2019 2019/05/09 07:34:29 (permalink) ☄ Helpfulby f.stojanovic 2019/05/10 05:06:58
5 (1)
 
It seems the usual short link is broken. It should get fixed shortly.
 
In the mean time, here are working links.
You need the toolbox v3.44 + the latest patch which fix known bugs and extend support for Matlab R2019a.
(current support is from R2010a to R2019a thus !)
 
 Toolbox:
webpage: https://www.microchip.com...PartNO/Simulink_Blocks
v3.44 direct download: http://ww1.microchip.com/...tlabTools-3.44-win.exe
 
patch (to run within matlab after toolbox installation):
https://microchiptechnolo...Qqg9gwPCB5fw7sEdIxPSrw
click on download on top of the page. 
 
We work at simplify the dual download requirement.
Keep tune for updates.
 
Lubin
#3
maxx200
New Member
  • Total Posts : 1
  • Reward points : 0
  • Joined: 2019/05/09 08:33:47
  • Location: 0
  • Status: offline
Re: MPLAB Device Blocks for Simulink 2019 2019/05/09 14:05:24 (permalink)
0
Hi!


how to use patch?

 
 

 





 
 
#4
Lubin
Moderator
  • Total Posts : 373
  • Reward points : 5
  • Joined: 2007/03/31 07:38:15
  • Location: Bayonne, France
  • Status: offline
Re: MPLAB Device Blocks for Simulink 2019 2019/05/09 15:32:29 (permalink)
0
The .p file is to run within matlab.
 
From Matlab, go to the folder where the .p file is. Then right click => run (or directly type the name of the file without extension)
 
#5
f.stojanovic
New Member
  • Total Posts : 18
  • Reward points : 0
  • Joined: 2019/05/07 01:56:09
  • Location: 0
  • Status: offline
Re: MPLAB Device Blocks for Simulink 2019 2019/05/10 05:16:02 (permalink)
0
That's great, it seems to be working nicely. I've tinkered a bit with it, for the most part it is fairly straightforward, although I just can't seem to wrap my head around this detail. I've read somewhere that only a few interrupt sources can be configured (I²C, SPI, CN and TIMER). Only timer works for me, the other three cannot be configured. Is there a way to manually configure and invoke interrupt routines for a given µC? Also, the CN block gives me this weird error (see attachment). One last question : is there a manual (PDF or otherwise) available for this blockset? Every attempt to find one online gives me either vastly outdated or incomplete information.
 
Thank you very much Lubin! ~Phil
post edited by f.stojanovic - 2019/05/10 05:17:36

Attached Image(s)

#6
Lubin
Moderator
  • Total Posts : 373
  • Reward points : 5
  • Joined: 2007/03/31 07:38:15
  • Location: Bayonne, France
  • Status: offline
Re: MPLAB Device Blocks for Simulink 2019 2019/05/14 02:29:51 (permalink)
0
Hi Phil,
 
Thanks for your feedback.
 
Please try creating one forum thread per question whenever possible.
 
Interrupts:
Peripheral are handled in background and already benefits from interrupts (I2C, SPI, UART, CN…). Your model-based design might not require interrupts thus.
 
However, in some specific case, interrupt might be required for example within the interrupt driven I2C sequence. Such « user interrupt » can be defined within the I2C, or SPI block which define the sequence. Subsystem executed will be part of the I2C or SPI interrupt. User responsibility to make is fast.
 
For change Notification, interrupt is provided as well to be able to react asynchronously to any change on specific a pin (for brushless motor using a hall effect sensor to switch magnetic field steps).
 
Same for Timers which allows to create an asynchronous task at any given rate.
Note however that it is much better using the multi-rate modeling capability of Simulink. A multitasking scheduler is implemented by default when more than one rate is present. It can be forced to a single tasking scheduler which would provide much more constraints on real-time (require to slice any slower tasks to fit in between higher tasks slots).
 
CN :
Could you post your model for me to check ?
 
Lubin
#7
f.stojanovic
New Member
  • Total Posts : 18
  • Reward points : 0
  • Joined: 2019/05/07 01:56:09
  • Location: 0
  • Status: offline
Re: MPLAB Device Blocks for Simulink 2019 2019/06/03 07:04:32 (permalink)
0
Hi Lubin,
 
The issue was as simple as default parameters being unavailable, so a conflict between different peripherals on same pins occurs.
 
Cheers,
~Phil
#8
Jump to:
© 2019 APG vNext Commercial Version 4.5