12.07.2015 Views

201305.pdf 43279KB May 08 2013 11:07:04 PM

201305.pdf 43279KB May 08 2013 11:07:04 PM

201305.pdf 43279KB May 08 2013 11:07:04 PM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

designideasConnect a 4×3 matrix keyboardto a microcontroller using two I/O pinsAruna Prabath Rubasinghe, University of Moratuwa, Moratuwa, Sri Lanka↘Matrix keyboards are commonas an input device in microcontroller-basedprojects. A conventionalway of connecting a matrix keyboardto a microcontroller is to use multipleI/O pins of the MCU. The MCU thenuses a scanning algorithm to identifywhich keys are pressed. A drawback ofthis method is that it requires a largenumber of the MCU’s I/O pins to connectthe keyboard. For example, toconnect a 4×3 keyboard requires sevendigital I/O pins. This becomes a problemwhen the project is based on alow-pin-count MCU or when theMCU being used does not have enoughfree I/O pins.Two solutions for this issue areavailable: Use readily available I/Oexpanders, or assign a unique voltageto each key using a resistor networkand then use an analog pin to readthe voltage and determine which keyis pressed. Each solution has its owndisadvantages.Since most of the time I/O expandersrequire a special communicationprotocol (I 2 C or SPI, for example) toread and write data, the MCU shouldhave built-in communication modules,or the user has to implement therelevant communication-protocol softwarewisely, which adds significantlyto the overhead of the MCU. On theD 21N4148D <strong>11</strong>N4148D 31N4148D 51N4148D 41N4148CLOCKR 310k1413 ECLKIC 14017Q0 3Q1 2Q2 4Q3 7Q4 10Q5 1Q6 5Q7 6Q8 9Q9 <strong>11</strong>D 7D 8D 9R <strong>11</strong>kR 41kR 51kR 61kABCD1 2 31 2 34 5 67 8 90 #D 61N4148R 747kINTERRUPTD 10NOTE: DIODES D 7 , D 8 , D 9 , AND D 10 ARE EACH A 1N4148.15MR12CO1413 ECLKIC 24017Q0 3Q1 2Q2 4Q3 7Q4 10Q5 1Q6 5Q7 6Q8 9Q9 <strong>11</strong>15MR12COFigure 1 This circuit for a 4×3 keyboard shows a more efficient architecture using two CD4017 Johnson counters with only twoI/O pins.52 EDN | MAY <strong>2013</strong> [ www.edn.com]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!