Aaeon PFM-535S Instrukcja Użytkownika Strona 38

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 53
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 37
PC/104 CPU Module PFM-535S
Appendix A Programming the Watchdog Timer A-5
WDT0 DOS Example
#include <stdio.h>
#include <conio.h>
void main()
{
unsigned char c;
unsigned int lTime;
outp(0x22,0x13); // Lock register
outp(0x23,0xc5); // Unlock config. register
// 500 mini-second
lTime = 0x20L * 500L;
outp(0x22,0x3b);
outp(0x23,(lTime>>16)&0xff);
outp(0x22,0x3a);
outp(0x23,(lTime>> 8)&0xff);
outp(0x22,0x39);
outp(0x23,(lTime>> 0)&0xff);
// Reset system
outp(0x22,0x38);
c = inp(0x23);
c &= 0x0f;
c |= 0xd0; // Reset system. For example, 0x50 to trigger IRQ7
outp(0x22,0x38);
outp(0x23,c);
// Enable watchdog timer
Przeglądanie stron 37
1 2 ... 33 34 35 36 37 38 39 40 41 42 43 ... 52 53

Komentarze do niniejszej Instrukcji

Brak uwag