problem with simulation time step, mips & measured freq
Posted: Wed Jan 11, 2012 12:34 am
Lubin,
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,
Leonardo
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?
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,
Leonardo
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?