Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.naic.edu/~phil/td/littleStarInterrupts.html
Дата изменения: Mon Feb 27 00:14:34 2012
Дата индексирования: Tue Oct 2 09:57:21 2012
Кодировка:

Поисковые слова: п п п п п п п п п п п п
little star interrupts

Little star: interrupts, program timing

22feb12

Interrupts
How the timing works


Interrupts (top)


This info comes from: pk2200 series users manual (appendix D page 85) (.pdf):
    To use interrupts:
ADDRESS
priority
1=highest
Internal/
external
Name
Description

1
int
TRAP
undefined opcode trap
0x66
2
ext
NMI
Non maskable interrupt
66 is absolute address.

3
ext
INT0_VEC
Connetct to digital input 11
0x00
4
ext
INT1_VEC
Expansion bus attention /INT1 vector
0x02
5
ext
INT2_VEC /INT2 vector
connected to digital input 12
  • AO 1 sec tick interrupt
0x04
6
internal
PRT0_VEC
PRT time1channel 0 (timer0)
  • i/o register locations:
    • TMDR0L,TMDR0H - timer data register
    • RLDR0L,RLDR0H - timer reload register
    • TCR -0 timer control
  • Real Time Kernel  timer interrupt. Used to schedule the tasks
    • 5 millisec controlLaw get started by rtk via this interrupt.
0x06
7
internal PRT1_VEC
PRT timer channel 1
0x08
8
internal DMA0_VEC
DMA channel 0
0x0A
9
internal DMA1_VEC
DMA channel 1
0x0C
10
internal CSIO_VEC
Clocked serial I/O
0x0E
11
internal SER0_VEC
Asynchronous serial port chan0
0x10
12
internal SER1_VEC
Asynchronous serial port chan1
NOTES:


How the timing  works:  (top)

Tiedown time systems:

    There are a few "time systems" used with the tiedowns:

Running the controlLaw (PID) routine every 5 milliseconds:

 The controlLaw for the pid loop is scheduled every 5 milliseconds by the Real Time Kernel (RTK) running on the little star computers. A 16 bit timer register is used to generate the interrupt. It is driven by the 18.432Mhz oscillator on the little star. A one second tick (from the maser) interrupts once a second and rephases the 16 bit timer so the control law will run 1 millisecond after the 1 second tick. This happens every second (as long as the 1 second ticks are arriving).It the 1 second ticks do not arrive, then the rephasing does not occur and the 5 millisecond period can drift (since the little star oscillator isn't exactly 18.432 Mhz).
    The notes below show how this is done. The setup is done in the little star program tiedownq.c.



<- page up
home_~phil