Blockset described on this wiki is deprecated since 2012.
For Model Based Design (MBD), use the free MPLAB Device Blocks for Simulink, tool from Microchip.
Updated Rapid Control Prototyping (RCP) custom projects are published at: https://lubin.kerhuel.eu.
Difference between revisions of "DsPIC Block/Master"
LubinKerhuel (talk | contribs) m |
LubinKerhuel (talk | contribs) m (LubinKerhuel moved page Block/Master to DsPIC Block/Master: Block is a special page, creates many issues) |
(No difference)
|
Latest revision as of 19:30, 3 May 2015
The Master block set important dsPIC options like PLL, Quartz used, and share theses parameters with others blocks from the blockset.
Contents
Dialog Box Parameters
The dialog box parameters differs depending on which microcontroller is used. Unexpected close of the dialog box and few errors when re-opening it may appears when selecting a different chip. This has no consequence.
The principal change concern the Real Time Quartz tab. see Instruction Cycle Frequency
Step Based on
- Tmer1 : The model time step is set using the Timer1 automatically configured (Prescaler and PR1).
- ADC : The ADC conversion time can be used only when the ADC block is set to produce two or more sample per channel. The conversion time is 'augmented' so as to have reach the model time step at the end of all conversion needed in 1 time step.
- Free Run : The model execute at its maximum speed. The Time step is not constant since the calculation time may changed slightly between time step. The simulink model time step is not taken into acount.
PIC
Specify the Microchip microcontroller target.
59 Supported devices :
See Release Notes and known bug for details
|
Instruction Cycle Frequency
Specify or shows the number of Instruction Per Secondes (MIPS) executed (in million here). Configuratoin of UART baud, timers prescaler and the real-timetime step rely on this frequency information.
- For 30f family microcontroller
- You must compute yourself the Instruction Per Seconds using :
[math] IPS = \frac{FreqQuartz}{4} * PLL_{factor}[/math]
- With FreqQuartz the frequency of the source (Quartz or internal oscillator, External Clock ...) and with PLL factor set to 1 when PLL multiplication is not used.
- For 24, 33 and 32 microcontroller
- The Instruction Per Seconds is automatically computed using the Quartz frequency provided. If you activate the PLL multiplication, you have to enter the Desired Instruction Cycle Frequency (24f,32f and 33f dialog box only).
- From the entered Desired Instruction Cycle Frequency, the toolbox compute the best PLL multiplication which provides the Instruction Cycle Frequency the closest to the Desired one.
Config Timer
Set the prescaler for the timer 2,3 and 4,5 when available in the microcontrôller. Theses times are used by certain periphery like Output Compare, Input Capture. Set -1 for the timer prescaler to be set by matlab using optimal criterion.
Forcing a prescaler for one timer can be done by replacing -1 with your prescaler value. You must beware that when one peripheral use a timer, the timer value must not be changed as this would cause peripheral failure. Setting two timers with the same prescaler will insure that the second one will not be used by any peripheral. You will then be able to modify this timer value without affecting peripheral.
32 bits timer cannot be configured.
Busy Flag Port
Set the port specified to 1 during the time step calculation and 0 during idle time. This allow to check that all calculation are finished in less that one time step.
Overload Flag Port
Set the port specified to 1 during one time step if the previous time step was not finished when starting the execution of current time step.
config Oscillator mode
Sepecify PIC Oscillator configuration.
config Born Out Reset
Specify Voltage under which the microcontrôller Reset.
config Power Time
Specify time for the pic to start onced powered. (Lets time for alimentation tension to settle properly before starting instructions execution).
config MCLR
If disable, MCLR pin has not the hardware reset function on programme execution. When enable, Pic stop execution and reset when MCLR pin is in its low state.
<comments \>