1 /** ###################################################################
2 ** THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
3 ** Filename : TickTimer.H
5 ** Processor : MC9S12DP256BCPV
7 ** Version : Bean 02.063, Driver 01.05, CPU db: 2.87.283
8 ** Compiler : Metrowerks HC12 C Compiler
9 ** Date/Time : 18/06/2005, 16:21
11 ** This bean "TimerInt" implements a periodic interrupt.
12 ** When the bean and its events are enabled, the "OnInterrupt"
13 ** event is called periodically with the period that you specify.
14 ** TimerInt supports also changing the period in runtime.
15 ** The source of periodic interrupt can be timer compare or reload
16 ** register or timer-overflow interrupt (of free running counter).
18 ** Timer name : ECT (16-bit)
20 ** Counter shared : No
22 ** High-speed CPU mode
23 ** Prescaler : divide-by-8
25 ** Initial period/frequency
27 ** microseconds : 1000
29 ** seconds (real) : 0.0010000
33 ** Runtime setting : period/frequency interval (continual setting)
34 ** ticks : 16000 to 320000 ticks
35 ** microseconds : 1000 to 20000 microseconds
36 ** milliseconds : 1 to 20 milliseconds
37 ** seconds (real) : 0.0010000 to 0.0200000 seconds
45 ** Counter : TCNT [68]
48 ** Prescaler : TSCR2 [77]
53 ** Flip-flop registers
56 ** Enable - byte TickTimer_Enable(void);
57 ** SetPeriodTicks16 - byte TickTimer_SetPeriodTicks16(word Ticks);
58 ** SetPeriodTicks32 - byte TickTimer_SetPeriodTicks32(dword Ticks);
59 ** SetPeriodUS - byte TickTimer_SetPeriodUS(word Time);
60 ** SetPeriodMS - byte TickTimer_SetPeriodMS(word Time);
61 ** SetFreqHz - byte TickTimer_SetFreqHz(word Freq);
63 ** (c) Copyright UNIS, spol. s r.o. 1997-2002
68 ** http : www.processorexpert.com
69 ** mail : info@processorexpert.com
70 ** ###################################################################*/
75 /* MODULE TickTimer. */
79 #pragma CODE_SEG TickTimer_CODE /* Code section for this module. */
81 #define TickTimer_SPT16Min 16000 /* Lower bound of interval for method SetPeriodTicks16 */
82 #define TickTimer_SPT16Max 65535 /* Upper bound of interval for method SetPeriodTicks16 */
83 #define TickTimer_SPT32Min 16000 /* Lower bound of interval for method SetPeriodTicks32 */
84 #define TickTimer_SPT32Max 320000 /* Upper bound of interval for method SetPeriodTicks32 */
85 #define TickTimer_SPUSMin 1000 /* Lower bound of interval for method SetPeriodUS */
86 #define TickTimer_SPUSMax 20000 /* Upper bound of interval for method SetPeriodUS */
87 #define TickTimer_SPMSMin 1 /* Lower bound of interval for method SetPeriodMS */
88 #define TickTimer_SPMSMax 20 /* Upper bound of interval for method SetPeriodMS */
89 #define TickTimer_SFHzMin 50 /* Lower bound of interval for method SetFreqHz */
90 #define TickTimer_SFHzMax 1000 /* Upper bound of interval for method SetFreqHz */
93 byte TickTimer_Enable(void);
95 ** ===================================================================
96 ** Method : TickTimer_Enable (bean TimerInt)
99 ** Enable the bean - it starts the timer. Events may be
100 ** generated ("DisableEvent"/"EnableEvent").
103 ** --- - Error code, possible codes:
105 ** ERR_SPEED - This device does not work in
106 ** the active speed mode
107 ** ===================================================================
110 byte TickTimer_SetPeriodTicks16(word Ticks);
112 ** ===================================================================
113 ** Method : TickTimer_SetPeriodTicks16 (bean TimerInt)
116 ** This method sets the new period of the generated events.
117 ** The period is expressed in Xtal ticks as a 16-bit unsigned
119 ** This method is available only if runtime setting type
120 ** 'from interval' is selected in the Timing dialog box in
121 ** Runtime setting area.
123 ** NAME - DESCRIPTION
124 ** Ticks - Period to set [in Xtal ticks]
125 ** (16000 to 65535 ticks)
127 ** --- - Error code, possible codes:
129 ** ERR_SPEED - This device does not work in
130 ** the active speed mode
131 ** ERR_MATH - Overflow during evaluation
132 ** ERR_RANGE - Parameter out of range
133 ** ===================================================================
136 byte TickTimer_SetPeriodTicks32(dword Ticks);
138 ** ===================================================================
139 ** Method : TickTimer_SetPeriodTicks32 (bean TimerInt)
142 ** This method sets the new period of the generated events.
143 ** The period is expressed in Xtal ticks as a 32-bit unsigned
145 ** This method is available only if runtime setting type
146 ** 'from interval' is selected in the Timing dialog box in
147 ** Runtime setting area.
149 ** NAME - DESCRIPTION
150 ** Ticks - Period to set [in Xtal ticks]
151 ** (16000 to 320000 ticks)
153 ** --- - Error code, possible codes:
155 ** ERR_SPEED - This device does not work in
156 ** the active speed mode
157 ** ERR_MATH - Overflow during evaluation
158 ** ERR_RANGE - Parameter out of range
159 ** ===================================================================
162 byte TickTimer_SetPeriodUS(word Time);
164 ** ===================================================================
165 ** Method : TickTimer_SetPeriodUS (bean TimerInt)
168 ** This method sets the new period of the generated events.
169 ** The period is expressed in microseconds as a 16-bit
170 ** unsigned integer number.
171 ** This method is available only if runtime setting type
172 ** 'from interval' is selected in the Timing dialog box in
173 ** Runtime setting area.
175 ** NAME - DESCRIPTION
176 ** Time - Period to set [in microseconds]
177 ** (1000 to 20000 microseconds)
179 ** --- - Error code, possible codes:
181 ** ERR_SPEED - This device does not work in
182 ** the active speed mode
183 ** ERR_MATH - Overflow during evaluation
184 ** ERR_RANGE - Parameter out of range
185 ** ===================================================================
188 byte TickTimer_SetPeriodMS(word Time);
190 ** ===================================================================
191 ** Method : TickTimer_SetPeriodMS (bean TimerInt)
194 ** This method sets the new period of the generated events.
195 ** The period is expressed in miliseconds as a 16-bit
196 ** unsigned integer number.
197 ** This method is available only if runtime setting type
198 ** 'from interval' is selected in the Timing dialog box in
199 ** Runtime setting area.
201 ** NAME - DESCRIPTION
202 ** Time - Period to set [in miliseconds]
203 ** (1 to 20 milliseconds)
205 ** --- - Error code, possible codes:
207 ** ERR_SPEED - This device does not work in
208 ** the active speed mode
209 ** ERR_MATH - Overflow during evaluation
210 ** ERR_RANGE - Parameter out of range
211 ** ===================================================================
214 byte TickTimer_SetFreqHz(word Freq);
216 ** ===================================================================
217 ** Method : TickTimer_SetFreqHz (bean TimerInt)
220 ** This method sets the new frequency of the generated
221 ** events. The frequency is expressed in Hz as a 16-bit
222 ** unsigned integer number.
223 ** This method is available only if runtime setting type
224 ** 'from interval' is selected in the Timing dialog box in
225 ** Runtime setting area.
227 ** NAME - DESCRIPTION
228 ** Freq - Frequency to set [in Hz]
231 ** --- - Error code, possible codes:
233 ** ERR_SPEED - This device does not work in
234 ** the active speed mode
235 ** ERR_MATH - Overflow during evaluation
236 ** ERR_RANGE - Parameter out of range
237 ** ===================================================================
240 #pragma CODE_SEG __NEAR_SEG NON_BANKED /* Interrupt section for this module. Placement will be in NON_BANKED area. */
241 __interrupt void TickTimer_Interrupt(void);
242 #pragma CODE_SEG TickTimer_CODE /* Code section for this module. */
244 ** ===================================================================
245 ** Method : TickTimer_Interrupt (bean TimerInt)
248 ** This method is internal. It is used by Processor Expert
250 ** ===================================================================
253 void TickTimer_Init(void);
255 ** ===================================================================
256 ** Method : TickTimer_Init (bean TimerInt)
259 ** This method is internal. It is used by Processor Expert
261 ** ===================================================================
264 #pragma CODE_SEG DEFAULT /* Change code section to DEFAULT. */
268 #endif /* ifndef __TickTimer */
270 ** ###################################################################
272 ** This file was created by UNIS Processor Expert 03.33 for
273 ** the Motorola HCS12 series of microcontrollers.
275 ** ###################################################################