can't transfer WKPND_b to W in PS2 keyboard code
Hello,
I am debugging an interrupt controlled clocked serial reveiver for an AT PS2 keyboard. My problem is that I am not getting always 11 interrupts for a 1 start +8 data +1 parity+1 stop bit frame of 11 clock cycles. I see this by my data being misaligned by 1 bit (it happens in both directions) and also the downcounter I use for the quantity of bits received not equal to 0 after 11 interrupts.
QUESTION:
I would like to read the WKPND_B register, but the compiler is rejecting the second line of this piece of code:
mov M, #$09 ;WKPND_W get B change interrupt status register
mov w, !rb
How do I read WKPND_W?
Or does somebody have and ISR for a PS2 keyboard I could work with?
Frank
I am debugging an interrupt controlled clocked serial reveiver for an AT PS2 keyboard. My problem is that I am not getting always 11 interrupts for a 1 start +8 data +1 parity+1 stop bit frame of 11 clock cycles. I see this by my data being misaligned by 1 bit (it happens in both directions) and also the downcounter I use for the quantity of bits received not equal to 0 after 11 interrupts.
QUESTION:
I would like to read the WKPND_B register, but the compiler is rejecting the second line of this piece of code:
mov M, #$09 ;WKPND_W get B change interrupt status register
mov w, !rb
How do I read WKPND_W?
Or does somebody have and ISR for a PS2 keyboard I could work with?
Frank
Comments
When you access the WKPND_B register via "MOV !RB,W" it does a SWAP with the W register.
So the contents of W get put INTO WKPND_B and the previous contents of WKPND_B get put back into W.
MOV M,#$09
MOV W,#0
MOV !RB,W ; This swaps the values in WKPND_B and W
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
"You're braver than you believe, stronger than you seem, and smarter than you think" Christopher Robin to Pooh
·