ALPS Touchpad - absolute mode?

hi!

I have found plenty of documentation on how to put a Synaptics touchpad in absolute positioning mode over PS/2. For ALPS devices, however, I just barely was able to pick the hint* while googling, but there seems to be no documentation on how to interpret the data bytes received in this mode.

I have tried interpreting them myself (via binary output on the serial console), but i can't quite figure it out. Does anybody here have experience with ALPS touchpads? I have tried using Synaptics' data format, but it appears to be different. help is greatly appreciated!

  • if anyone's interested: to put an ALPS touchpad into absolute mode, send four disable commands 0xF5 before the enable command 0xF4...

I realize this is a rather old post, but for those who came here from google: you can find some information in the linux kernel module for this device.

The code can be found at http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=blob;f=drivers/input/mouse/alps.c;h=99d58764ef03573e94c624625ae64f710d06ee69;hb=HEAD

Well, but somehow this tip worked for me. i'm using the ps/2 lib from Arduino Playground

and changed the mouse init in the mouse-example to this:

void mouse_init()
{
  mouse.write(0xF5);  // reset
  mouse.write(0xF5);  // reset
  mouse.write(0xF5);  // reset
  mouse.write(0xF5);  // reset
  mouse.write(0xF4);  // reset
  mouse.read();  // ack byte
  mouse.read();  // blank */
  mouse.read();  // blank */
  mouse.write(0xf0);  // remote mode
  mouse.read();  // ack
  delayMicroseconds(100);
}

and now i am receiving absolute values, but only if i'm tapping or moving my finger a little bit on the pad, so if i only put my finger down to one place i won't get the values instantly.. pehaps there is anything i can change?!?

well, but for now, thats what i wanted, thanks for posting this hint, even if that wasn't the working for you.

oh and by the way i'm using ALPS JCI-S1S H

well that was not 100% correct, because there was something missing, you shouldn’t use 0xeb for “give me data”.
I’m pretty close now. Now I only have to combine the raw bytes…
because up to now its like having two values for X and for Y.
the first x is the detailed one, going from 0 to 128. the second one is the “multiplicator” from 8 to 56, i have to combine them, but I don’t know how. But I can manage it in the software afterwards, so for me this code is ok.
have a look:

#include <ps2.h>

/*
 * an arduino sketch to interface with a ps/2 trackpad.
 * based on the ps2_mouse.pde from Arduino playground converted to trackpad use by andreas brendle
 */

/*
 * Pin 5 is the mouse data pin, pin 6 is the clock pin
 * Feel free to use whatever pins are convenient.
 */
PS2 mouse(6, 5);

/*
 * initialize the trackpad. 
 */
void mouse_init()
{ //put trackpad in Absolute mode: 4Disable 1Enable
  mouse.write(0xF5);  // Disable
  mouse.write(0xF5);  // Disable
  mouse.write(0xF5);  // Disable
  mouse.write(0xF5);  // Disable
  mouse.write(0xF4);  // Enable
  mouse.read();  // ack byte
  mouse.read();  // blank */
  mouse.read();  // blank */
  mouse.write(0x00f0);  // poll mode
  mouse.read();  // ack
  delayMicroseconds(100);
}

void setup()
{
  Serial.begin(9600);
  mouse_init();
  Serial.println("ok");
}

/*
 * get a reading from the pad and report it back to the
 * host via the serial line.
 */
void loop()
{
  char mstat;
  char mx;
  char mx2;  
  char my;
  char my2;
  char mz;
  
  /* get a reading from the mouse */
  mouse.write(0x0f);  // give me data! 0xeb not working
  mouse.read();      // ignore ack
  mouse.read();
  mx = mouse.read();
  mx2 = mouse.read();
  my = mouse.read();
  my2 = mouse.read();
  mz = mouse.read();

  /* send the data back up */
  //  Serial.print(mstat, BIN);
  Serial.print("<x>");
  Serial.print(mx, DEC);
  Serial.print("</x>\t<x2>");
  Serial.print(mx2, DEC);
  Serial.print("</x2>");
  Serial.print("\t<y>");
  Serial.print(my, DEC);
  Serial.print("</y>\t<y2>");
  Serial.print(my2, DEC);
  Serial.print("</y2>");
  Serial.print("\t<z>");
  Serial.print(mz, DEC);
  Serial.println("</z>");
  
  //  delay(20);  /* twiddle */
}