198
Motion Control Theory
3. Reset timer continuously
After the watchdog protection mechanism is enabled, the
watchdog mechanism should be reset within timeout period
to rest the timer and retiming from beginning. In case of
timer timeout relevant events are triggered per setting given
by step 1.
Use
APS_wdt_reset_counter ()
to reset watchdog.
• Example:
void
watchdog_example()
{
// This example shows how interrupt functions work.
I32 board_id = 0;
I32 timer_no = 0;
// Only timer 0 to be used
I32 time_out = 10;
// Time out is 10*100 ms = 1 sec
I32 EventByBit = 0x01;
// Action event is defined by bit.
// Bit0: Motor servo off
// Bit1: Digital output off
// Bit2: PWM off
I32 ret = 0;
// return code
//Step 1:
姕⭂妰㗪☐妠䘤⼴䘬ḳẞ
ret = APS_wdt_set_action_event( board_id, timer_no, EventByBit );
//Step 2:
┇≽䚳攨䉿ᾅ嬟㨇⇞
ret = APS_wdt_start( board_id, timer_no, time_out );
//
ἧ䓐侭䘬
timer
炻
while loop
炻ㆾ侭㗗⎗⚆ㅱ溆
timer(500ms)
//
㭷
500ms
⍣慵伖ᶨ㫉妰㗪☐
{
//Step 3:
ᶵ攻㕟䘬慵伖妰㗪☐
ret = APS_wdt_reset_counter( board_id, timer_no );
…Do Something
}
}
Содержание PCI-8254
Страница 2: ...ii Revision History Revision Date Description 2 00 2014 08 13 First release ...
Страница 8: ...viii Table of Contents Important Safety Instructions 209 Getting Service 211 ...
Страница 12: ...xii List of Figures ...
Страница 14: ...xiv List of Tables ...
Страница 24: ...10 Introduction ...
Страница 54: ...40 Getting Start with The Installation ...
Страница 78: ...64 Signal Connection ...
Страница 111: ...Motion Control Theory 97 PCI 8254 PCI 8258 MCP2 Bode plot page ...
Страница 165: ...Motion Control Theory 151 PCI 8254 PCI 8258 Example Figure 4 55 Continuous interpolation examples ...
Страница 222: ...208 Motion Control Theory ...