Interfacing a PS/2 Touchpad with a 16F628A

Status
Not open for further replies.

Smartie

Member
Interfacing a PS/2 Touchpad with a 16F628A (check it out!)

Hey guys,

just let you know that i have made a library that lets me interface a PS/2 touch pad on my 16F628A.

Atm, the source code to it isn't available but some time tomorrow I'll clean up the code and put it into a zip file on my site for you guys to download.

anyway check it out:
**broken link removed**

update:
Okay, i have just cleaned up the code and wrote a read me file and zipped them up for you guys to try. Please comment on what you think

Cheers
Roman
 

Attachments

  • touchpad.zip
    4 KB · Views: 158
Last edited:
quick question for you "experts"

i converted this function:
Code:
void send_tp_arg(byte arg) {
    byte i;
    for (i = 0; i < 4; i++){
        PS2_send(0xE8);
        PS2_send((arg >> (6-2*i)) & 3);
    }
}

into this:
Code:
PS2_send_tp_arg	;sends b'10110100' as b'00000010',b'00000011',b'00000001' and b'00000000';
	movwf	PS2_tp_arg
	movwf	PS2_tp_arg2
	movlw	0xE8
	call	PS2_send
	
	movlw	0x06
	movwf	PS2_COUNTB
tp_l1
	rrf		PS2_tp_arg2,F
	decfsz	PS2_COUNTB,F
	goto	tp_l1
	movfw	PS2_tp_arg2
	andlw	0x03
	call	PS2_send
	movfw	PS2_tp_arg
	movwf	PS2_tp_arg2
	
	movlw	0xE8
	call	PS2_send
	movlw	0x04
	movwf	PS2_COUNTB
tp_l2
	rrf		PS2_tp_arg2,F
	decfsz	PS2_COUNTB,F
	goto	tp_l2
	movfw	PS2_tp_arg2
	andlw	0x03
	call	PS2_send
	movfw	PS2_tp_arg
	movwf	PS2_tp_arg2
	
	movlw	0xE8
	call	PS2_send
	movlw	0x02
	movwf	PS2_COUNTB
tp_l3
	rrf		PS2_tp_arg2,F
	decfsz	PS2_COUNTB,F
	goto	tp_l3
	movfw	PS2_tp_arg2
	andlw	0x03
	call	PS2_send
	movfw	PS2_tp_arg
	movwf	PS2_tp_arg2
	
	movlw	0xE8
	call	PS2_send
	movfw	PS2_tp_arg2
	andlw	0x03
	call	PS2_send
	return
I'm not too sure if that's the best that can be done, do you guys think i did good there?
 
Great project.

I would have left it in C.

3v0
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…