| поискавой системы для электроныых деталей |
|
DM5806 датащи(PDF) 39 Page - List of Unclassifed Manufacturers |
|
|
|||||||||||||||||||||||||||||
DM5806 датащи(HTML) 39 Page - List of Unclassifed Manufacturers |
|
39 / 64 page ![]() 4-9 v = inportb(port_address); v = v & 199; v = v | 40; outportb(port_address, v); A final note: Don’t be intimidated by the binary operators AND and OR and try to use operators for which you have a better intuition. For instance, if you are tempted to use addition and subtraction to set and clear bits in place of the methods shown above, DON’T! Addition and subtraction may seem logical, but they will not work if you try to clear a bit that is already clear or set a bit that is already set. For example, you might think that to set bit 5 of a port, you simply need to read in the port, add 32 (25) to that value, and then write the resulting value back to the port. This works fine if bit 5 is not already set. But, what happens when bit 5 is already set? Bits 0 to 4 will be unaffected and we can’t say for sure what happens to bits 6 and 7, but we can say for sure that bit 5 ends up cleared instead of being set. A similar problem happens when you use subtraction to clear a bit in place of the method shown above. Now that you know how to clear and set bits, we are ready to look at the programming steps for the DM5806 board functions. Initializing the 8255 PPI Before you can operate the DM5806, the 8255 must be initialized. This step must be executed every time you start up, reset, or reboot your computer. The 8255 is initialized by writing the appropriate control word to I/O port BA + 3. The contents of your control word will vary, depending on how you want to configure your I/O lines. Use the control word description in the previous I/O map section to help you program the right value. Remember that the DM5806 cannot use Mode 2. In the example below, a decimal value of 128 sets up the 8255 so that all I/O lines are Mode 0 outputs. Digital I/O Operations Once the 8255 is initialized, you can use the digital I/O lines to control or monitor external devices. Timer/Counters An 8254 programmable interval timer provides three 16-bit, 8-MHz timer/counters for timing and counting functions such as frequency measurement, event counting, and interrupts. All three timer/counters are cascaded at the factory. Figure 4-1 shows the timer/counter circuitry. Each timer/counter has two inputs, CLK in and GATE in, and one output, timer/counter OUT. They can be programmed as binary or BCD down counters by writing the appropriate data to the command word, as described in the I/O map section at the beginning of this chapter. One of two clock sources, the on-board 8-MHz crystal or an external clock routed through on-board I/O connector P6 can be selected as the clock input to each timer/counter. In addition, the timer/counters can be cas- caded by connecting TC0’s output to TC1’s clock input and TC1’s output to TC2’s clock input. The diagram shows how these clock sources are connected to the timer/counters. An external gate source can be connected to each timer/counter through P6. When a gate is disconnected, an on- board pull-up resistor automatically pulls the gate high, enabling the timer/counter. The output from each timer/counter is available at P6, where it can be used for interrupt generation or for counting functions. The timer/counters can be programmed to operate in one of six modes, depending on your application. The following paragraphs briefly describe each mode. D7 D6 D5 D4 D3 D2 D1 D0 10000000 |
|
ссылки URL |
| Вашему бизинису помогли Аллдатащит? [ DONATE ] |
Что такое Аллдатащит | реклама | контакт | Конфиденциальность | Ссылка на техническое описание | обмен ссыками | поиск по производителю All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |