Shop OBEX P1 Docs P2 Docs Learn Events
QS Board strange behaviour from touchpads — Parallax Forums

QS Board strange behaviour from touchpads

skylightskylight Posts: 1,915
edited 2011-11-28 15:37 in Propeller 1
This has been resolved from another post titled " QS Board programming the touchpads"

Following on from my other post using the touchpads on the Quickstart Board, I have noticed a strange anomaly with using the INA command.

Here's the code being used:
CON 
  _clkmode = xtal1 + pll16x 
  _CLKFREQ = 80_000_000 
VAR byte time 
PUB LedCounter 
time:=4 
dira[16..23] :=111111 
repeat
  If (ina[0] == 1)
    outa[16..23] :=1 
    waitcnt(clkfreq/time + cnt) 
    outa[16..23] :=2 
    waitcnt(clkfreq/time + cnt) 
    outa[16..23] :=4 
    waitcnt(clkfreq/time + cnt) 
    outa[16..23] :=8 
    waitcnt(clkfreq/time + cnt) 
    outa[16..23] :=16 
    waitcnt(clkfreq/time + cnt) 
    outa[16..23] :=32 
    waitcnt(clkfreq/time + cnt) 
    outa[16..23] :=64 
    waitcnt(clkfreq/time + cnt) 
    outa[16..23] :=128 
    waitcnt(clkfreq/time + cnt) 
  else
    outa[16..23] := 0

The designated pad will run the led chase but I have also noticed that any value of 0,1,or 2 used in the If (INA
[*]==1
(substitute value for *) statement will also allow the two pads to the left of the designated pad to run the chase also if pressed together this only works up to 2, 3 to 7 are ok and only the designated pad will run the chase.

Is there some mathmatical summing of input bits causing the problem or a hardware problem as it only works with the lower buttons not the higher ones?
Is there some piece of code that avoids this problem that I havn't read about yet?

Comments

  • bsnutbsnut Posts: 521
    edited 2011-11-28 06:11
    Skylight,

    The code that posted in the other thread should work from pins 0 - 7 only and that's because the touch buttons are connected to these pins only.

    BTW, you didn't need to start another thread for this problem since it's still related to the one you started earlier.
  • skylightskylight Posts: 1,915
    edited 2011-11-28 06:57
    bsnut wrote: »
    Skylight,

    The code that posted in the other thread should work from pins 0 - 7 only and that's because the touch buttons are connected to these pins only.

    BTW, you didn't need to start another thread for this problem since it's still related to the one you started earlier.
    Thanks bsnut I wasn't sure whether to post new as it was a fault whereas the other post was more about how to program so was a bit confused as to what to do.
    I understand about the buttons being 0-7 my post above has probably confused everyone, I wasn't trying to suggest that there were more input pads than those but that the command seemed to do funny things up to INA[2], INA[3] to INA[7] worked fine, still don't understand why they worked at all given what Ariba was saying about charging the pins capacitor first but they did up to a fashion.
    Mybe there is stray capacitance always around the pins until you put them into a known state by charging first? hence why some pins worked together to trigger the chase? Just guessing here, perhaps the hardware guys have an answer?
  • bsnutbsnut Posts: 521
    edited 2011-11-28 15:37
    That's ok. The goal is to show you the basics, which you already did and I just added the input.

    What I would suggest you to do is download the Quickstart PDF so you can look at the schematic to understand how the propeller is connected to everything on the board.
Sign In or Register to comment.