problem with simulation time step, mips & measured freq

Create new topics, add your comment, remark, bugs...
Post Reply
Posts: 1
Joined: Tue Jan 10, 2012 11:52 pm

problem with simulation time step, mips & measured freq

Post by leonk » Wed Jan 11, 2012 12:34 am

Great Blockset and excelent support!!!
I've found some differences between the setted and measured freq of a blinking LED. It appears that the freq depends on the MIPS and the simulation time step ts.
Ive found:
if ts[s] x MIPS < 0.0053 -> LEDfrec[hz] = 340 x ts
if ts[s] x MIPS > 0.0053 -> LEDfrec[hz] = 1.8 /MIPS

each time i change ts, i also change the period samples to get 1 hz blinking freq. In the attached model, i measured 1.82 hz

weird? am i misconfigurating the model? im using matlab2010b, dsPIC30f4013, with internal oscillator

Thank you very much,


PS: another doubt: the dspic datasheet says "The user can tune the FRC oscillator within a range of +10.5% (840 kHz) and -12% (960 kHz) in steps of 1.50%"
-> FRC[MHZ]: 8(nom); 7.04(min); 8.84(max).
-> ips = fosc/4,
-> ips = 1.76 a 2.21 mips
how does the blockset manage to set out of range ips?
(33.79 KiB) Downloaded 236 times

Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Bayonne- France

Re: problem with simulation time step, mips & measured freq

Post by LubinKerhuel » Thu Jan 12, 2012 10:48 am


Thanks for your question.
I mostly used the chips with an external quartz. I think that the blockset suport for the internal oscillator is pretty weak and I would not provide any garanty...

I joined Microchip to build-up a new blockset. This new blockset will handle differents oscillators in a much better way than it has been done with my custom blockset.
Thus if you are to use my custom blockset, considere using an external quartz which have been working very well so far (I used them exclusively !).
Considere switching to the Microchip official blockset in the next comming releases...

Regarding the tuning of the FRC resonator, it is not handled in my custom blockset. This will be handled in the Microchip futur blockset in prep...


Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests