Thanks.
Actually I found all the relevant info in geekhack.
Will see what I can do with a detailed howto.
Basically it can be done in the following steps:
1. get a trackpoint module
There's not much I can say about this. I have got two trackpoint modules from a R40 keyboard, and the other from a R61.
2. find out the pinout, will need to know data, clock, vcc, ground, and pins for buttons
The pinouts can be found in this thread:
http://geekhack.org/index.php?topic=8971.0 There are different pinouts. Luckily the two I got are both covered in that thread.
For convenience, I have attached some pictures.
This is the one from a R40 keyboard. I have labelled relevant pins (there are two extra pins).
Front:
Back:
This is the one from a R61 keyboard. The GND pin is connected to some where else, because I have accidentally ripped the trace
Front:
Back:
I also attached a pdf file with all these info together.
3. wire it to teensy or controller, you need two pins for clock and data, you can connect vcc and ground elsewhere
This is the most daunting part, I will add more info later
Reference:
http://geekhack.org/index.php?topic=8971.msg775152#msg775152 Only two connections between trackpoint module and controller are required: DATA and CLOCK.
Trackpoint modules needs other connections, including the three buttons and VCC/GND.
If using tmk firmware by hasu, some electric components are required to build a R/C network for the RST pin of the trackpoint module, including:
a. resistor: 4.7k ohm x 2 (pull-up resistors for DATA and CLOCK, one between DATA/VCC, and the other between CLOCK/VCC)
b. resistor: 100k ohm x 1 (between RST/GND)
c. capacitor: 2.2 uF x 1 (between RST/VCC, and note the polarity)
The wiring would look like this:
The R/C network is used to send a signal to reset the trackpoint module.
NOTE: DO NOT CONNECT THE RST PIN ON TEENSY, IT IS USED TO RESET TEENSY, NOT THE TRACKPOINT MODULE.
IIRC, if using suka's firmware, the R/C network is not required. But the reset pin of trackpoint module should connect to
another pin on teensy, in order to send a reset signal to the trackpoint module.
4. change the firmware, build and load into teensy, done!
I am using tmk firmware by hasu.
Change the config.h file (corresponding to the wiring above, if wired to different pins, you can change the code accordingly)
/* PS/2 mouse */
#ifdef PS2_USE_BUSYWAIT
# define PS2_CLOCK_PORT PORTD
# define PS2_CLOCK_PIN PIND
# define PS2_CLOCK_DDR DDRD
# define PS2_CLOCK_BIT 5
# define PS2_DATA_PORT PORTD
# define PS2_DATA_PIN PIND
# define PS2_DATA_DDR DDRD
# define PS2_DATA_BIT 4
#endif
Also modify the Makefile, adding the following:
PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support
PS2_USE_BUSYWAIT = yes
include $(TOP_DIR)/protocol.mk # if not already there
Rebuild the firmware and load into teensy, it should work now.