thanks this help very much. then, i could have 16 I (not only 8) if i connect my switches like this?
http://www.8051projects.net/keypad-interfacing/keypad-schematic.gif
and, will i need some resistor when the low became high?
To: From: Date: Tue, 29 Sep 2009 14:43:25 +0000 Subject: [ts-7000] Re: only DIO 1,3,5,7 works
--- In m("yahoogroups.com","ts-7000");">.com, salva g <salvagrana@ ...> wrote:
>
>
> Hi
> i am working with this code(button sample) but only responds with pins DIO nº1,3,5,7 when they are shorted to earth by pin DIO nº2. Why 9,11,13,15 does not work?
>
If you read the code, you will see that it sets the lower 4 pins to be inputs and the upper 4 to be outputs.
The keypad is a matrix of switches so you set one of the outputs high and see if any of the inputs becomes high. That's how you can connect 16 switches (4 x 4) on 8 (4+4) DIO pins.
>
> *PBDDR = 0xf0; //upper nibble output, lower nibble input
> *GPIOBDB = 0x01; //enable debounce on bit 0
> state = *PBDR; // read initial state
>
Charlas más divertidas con el nuevo Windows Live Messenger
__._,_.___
__,_._,___
|
|