Hi!
Thank you man. I put the delay at the part of the code that you told
me and it really works... I was in a mistake because I was putting
the delay out of the scanning code. Really it works man, you saved my
life :)
regards,
sergio
--- In Per Öberg <> wrote:
>
> Hello!
>
> There might be a problem with such a long cable due to the way the
> keypad is read.
>
> I assume that you're talking about the 4x4 keypad from TS and that
it is
> coupled to the DIO pins on PortB. The keypad short-circuits
different
> pins when the buttons are pressed and the reading algorithm tries
to
> find out which pins are short circuited by setting some of the pins
as
> inputs and some of the pins as outputs. (If you want the specifics
there
> is a somewhat readable datasheet on ACT components website)
>
> Given the long distance there might be a number of problems.
>
> 1) Because of the distance and the capacitive nature of a long
ribbon
> cable there might be a slightly larger delay than usual between the
time
> that the output is set high and when the voltage rises on the
input. To
> solve this you might try adding a delay of a couple of instructions
in
> the scanning code.
>
> More specific:
>
> > for(pos = 0; pos < 4; pos++) {
> > *pbddr = (1 << pos);
> > *pbdr = ~(1 << pos);
> > DELAY HERE
> > on |= (~(*pbdr >> 4) & 0xf) << (4 * pos);
> > }
> > return on;
>
> 2) To high total resistance. During the scanning process some of
the
> pins are output and some are inputs and a output pin is driving on
of
> the input pins when pressing a key. It is essential that the total
> resistance from input to output (i.e. double the length of the
cable +
> the internal resistance of the keypad) does not sink the voltage on
the
> input pins to much. I doubt that 10 feet is enough though.
>
>
>
> salazarluquin_sf wrote:
> > Hello, I Am trying to use a cable of 10 feet with my keypad and I
use
> > the code of sample that provide with the documentation of the ts-
7200
> > nevertheless the keypad does not work very well. I think that it
is a
> > kind of noise in the cable. What can I do to solve this problem
or what
> > type of cable I have to use? Thank you.
> > Note: I use the same cable in 4 feet and works well, but I need
it for
> > 10 feet.
> >
> >
> >
> >
> > Sergio
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|