| Electronic Components Datasheet Search |
|
AN2591 Datasheet(PDF) 7 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2591 Datasheet(HTML) 7 Page - STMicroelectronics |
|
7 / 19 page ![]() AN2591 Expanding the number of inputs 7/19 2 Expanding the number of inputs To expand the number input lines, for example to get the state of several bi-state sensors or to scan switch states, two techniques can be used: using multiplexers or shift registers. 2.1 Using a multiplexer 2.1.1 Expanding the number of inputs to 8 lines Figure 5 shows an example of how a multiplexer can be connected to the microcontroller. To get a bit value from a multiplexer input, apply the address value of the input via address lines (A, B and C) and read it in via the multiplexer OUT output (pin 5). To get all 8 bits of data available on the inputs (D0 to D7), you must read all bit states sequentially from the MSB (address value = 0x7) to LSB (address value = 0x0) by decrementing the bit address and applying it on GPIO0.0 to GPIO0.2. For each bit address you read the bit value and shift it into the microcontroller on GPIO0.3 by software to build a data byte. The multiplexer used is the M74HC151. This allows you to save 8 - 4 = 4 lines. Figure 5. Expander for 8 inputs using a multiplexer: M74HC151 µC GPIO0.3 Out GPIO0.0 M74HC151 5 GPIO0.1 GPIO0.2 D0 D1 D2 D3 D4 D5 D6 D7 4 2 3 1 15 14 13 12 Vcc 16 ST 7 3.3V GND C B A 8 inputs 11 10 9 8 |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List 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 |