このページはOS-Wikiのページのコピーです。


PIT 8254のページ  

関係するI/Oポート  

AT互換機  

TOWNS  

PC-9801  

8254の基礎  

ものぐさなひとのために  

6つのモード  

こめんと欄  

story - Lu register -0x3fdb (8bit and R/W): The counter 1 (unless this way it is, it cannot access with the normal mode of many types. The for BEEP) -- you use with mode 3. -0x3fdf (8bit and W): The short story - the Lu register -- here especially and the 0x0077 which the light/write are done as for the light/write doing completely the same * the foundation of 8254 as for -8524 3 it has the counter of the 16bit inside. Respectively, it can give the clock from outside and (with mostly, as given the identical clock, but, it is possible in addition to drive each one with separate mode. - Count as a general rule is decrement, with periodic mode command is reloaded instantaneously count has become 0 (to be plugged every single count value 0 value cannot read out). - Hardware, three signal pins below are related, (as for these there is just a quantity of the counter). --CLK: The clock (the clock in order decrement to do the counter) the --GATE: The pin in order the gate (you make the counter start and/or make stop and/or at one time to reopen) the --OUT: The output pin of the PIT which is controlled out (by count value, the り which has become the り cBeep output where this had become the trigger of the IRQ has done) - count, is a binary count mode and a BCD count mode. There is a BCD mode in pure 8254 being to be a possibility BCD mode being abbreviated, but concerning those which were accumulated to the tip/chip set of the PC, we cannot recommend. As for -8254, it can grasp present count value with latch, but there is no method of grasping command. We probably would like to know command, the counter leading/reading many degrees, watching, there is no other choice but to acquire maximum value. -- using lead/read back command, there is also a technique which at the little presumes accurate command number of samplings. - Meaning of each bit is of control register as follows. --bit0: Count mode ---0: Binary count ---1: BCD count --bit1-3: Count mode ---000: Mode 0 (terminal count) ---001: Mode 1 (programmable one shot) ---x10: Mode 2 (rate generator) ---x11: Mode 3 (square wave rate generator) ---100: Mode 4 (software trigger strobe) ---101: Mode 5 (hardware trigger strobe) --bit4-5: Counter access mode ---11: 16bit lead/read load (order of subordinate 8bit and superior 8bit) ---10: Lead/read load of superior 8bit ---01: Lead/read load of subordinate 8bit ---00: Count value latch --bit6-7: Counter channel appointment ---00: Counter 0 ---01: Counter 1 ---10: Counter 2 ---11: Lead/read back command (later description) - count value is set, it does generally with procedure below. -- the short story - it sets the mode of the channel which would like to set to the Lu register. Being the same mode as immediately before, it does not set this you question, there are times which it sows and does not operate. You set value to -- and the intended counter. If 8bit mode it becomes the access of 1 time if and, 16 bit mode, you write to the order of the subordinate 8bit and the superior 8bit. When -- from mode setting, during to completion of setting of count value, it does the mode setting of the other channel and/or reads and writes to the counter of the other channel, setting and behavior become uncertainty. - To grasp count value, it does generally with the following procedure. -- the short story - using the Lu register, it executes latch vis-a-vis the channel which we would like to grasp. -- counter access mode of reading becomes same as the mode when writing in. The *** thing ぐ because - the spotted ゃ っ け, you think many of the reader because of one, it sets the timer and the BEEP with the AT compatible machine, just there the ぱ suddenly explanation. -IRQ0 interruption periodic modification: --AL = 0x34; OUT (0x43, AL); --AL = it interrupts, the subordinate 8bit of period; OUT (0x40, AL); --AL = it interrupts, the superior 8bit of period; OUT (0x40, AL); -- with this end. When -- 0 is appointed to interruption period, it is regarded 65536 was appointed. As for actually interruption frequency, clock / setting count value. In other words, if it appoints 1000, the 1.19318kHz. If 10000 the 119.318hz, with the condition which was said. For example if 11932 is set, becoming approximately 100Hz, it is the case that it reaches the point where it interrupts every 10ms. -BEEP control of sound: -- musical interval operation: ---AL = 0xb6; OUT (0x43, AL); Subordinate 8bit of ---AL = command; OUT (0x42, AL); Superior 8bit of ---AL = command; OUT (0x42, AL); --- command 0 is handled as 65536. --- as for the musical interval which oscillates with this, clock / setting count value. In other words, if it appoints 1000, the 1.19318kHz. If 10000 the 119.318hz, with the condition which was said. For example if 2712 is set, it becomes approximately 440Hz. The ON/OFF of --BEEP: --- this uses the I/O port 0x61. ---ON: IN (AL and 0x61); AL |= 0x03; AL &= 0x0f; OUT (0x61, AL); ---OFF: IN (AL and 0x61); AL &= 0xd; OUT (0x61, AL); * Six modes * it is to include with the column - with the contents the K writing here as a reference [ [ as for setting of the timer inside the pic.cpp of the Mona ] ] it is the schedule which can be caught. -- [ [ [ [ the self-depreciation ぽ it is ] ] ] ] the SIZE (10) { 2004-01-09 (the gold) 21:55:07 } - a little as is useful, it is delightful, is. -- [ [ K ] ] SIZE (10) { 2004-01-10 (Saturday) 00:16:17 } void setTimerInterval (dword ms) { dword timerCounter = ms * 1193.18; Outportb (0x43, 0x34); Outportb (0x40, timerCounter & 0xff); Outportb (0x40, timerCounter >> 8); } - You tried making timer interruption periodic setting function. Argument is the ms. -- [ [ [ [ the self-depreciation ぽ is ] ] ] ] the SIZE (10) { 2004-01-11 (day) 03:51:43 } - [ [ above-mentioned function was tested with the Mona ] ], but it seems that is moving securely. -- [ [ [ [ the self-depreciation ぽ it is ] ] ] ] the SIZE (10) { 2004-01-11 (day) 17:26:52 } - when it tests with the apparatus it meaning that the kernel stops while starting, presently it is in the midst of investigating. -- [ [ [ [ the self-depreciation ぽ it is ] ] ] ] the SIZE (10) { 2004-01-11 (day) 21:05:49 } #comment


[リロード]   [トップ] [一覧] [単語検索] [最終更新]   [最終更新のRSS]