-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IBMPC: Send Command - Zenith Z-150 AT beige #661
Comments
Start bit Error
https://deskthority.net/viewtopic.php?p=477748#p477748 The log shows that the converter misses clock for start bit and stops sending data but keyboard still continues to clock pulsing. In the result:
https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol#zenith-z-150-beige
|
WAIT(clock_lo, 10000, 1); // [5]p.53, -10ms [5]p.50 |
60ms?
The keyboard checks the state of the 'clock' line at intervals of
no less than 60 milliseconds. If a request-to-send is detected, the
keyboard counts 11 bits.
p.4-16
http://bitsavers.org/pdf/ibm/pc/at/6183355_PC_AT_Technical_Reference_Mar86.pdf
diff --git a/tmk_core/protocol/ibmpc.c b/tmk_core/protocol/ibmpc.c
index 0e94e301..6b452f16 100644
--- a/tmk_core/protocol/ibmpc.c
+++ b/tmk_core/protocol/ibmpc.c
@@ -111,7 +111,7 @@ int16_t ibmpc_host_send(uint8_t data)
data_lo();
wait_us(100);
clock_hi(); // [5]p.54 [clock low]>100us [5]p.50
- WAIT(clock_lo, 10000, 1); // [5]p.53, -10ms [5]p.50
+ WAIT(clock_lo, 60000, 1); // [5]p.53, -10ms [5]p.50
/* Data bit[2-9] */
for (uint8_t i = 0; i < 8; i++) {
This didn't help a lot.
Fix 2.
And it may need to place inhibit state enough time(100us or 1-2ms?) to cancel/ignore clocking for sending process when the error happens.
tmk_keyboard/tmk_core/protocol/ibmpc.c
Lines 157 to 161 in 7e268c8
ERROR: | |
ibmpc_error |= IBMPC_ERR_SEND; | |
idle(); | |
IBMPC_INT_ON(); | |
return -1; |
diff --git a/tmk_core/protocol/ibmpc.c b/tmk_core/protocol/ibmpc.c [0/1986]
index 0e94e301..54fcdc2e 100644
--- a/tmk_core/protocol/ibmpc.c
+++ b/tmk_core/protocol/ibmpc.c
@@ -156,6 +156,8 @@ RECV:
return ibmpc_host_recv_response();
ERROR:
ibmpc_error |= IBMPC_ERR_SEND;
+ inhibit();
+ wait_ms(2);
idle();
IBMPC_INT_ON();
return -1;
This didn't help a lot also.
Retry
Retry for start bit works well somehow.
https://geekhack.org/index.php?topic=103648.msg3054043#msg3054043
Fixed repo at: 67d37ef
2021-06-03
With Stop bit error Fix 2 above
1
https://deskthority.net/viewtopic.php?p=478066#p478066 2
https://deskthority.net/viewtopic.php?p=478067#p478067 ISR:7E90 means FA is received from Zenith Z-150 AT. The debug logs don't show Start bit error( |
Zenith Z-150 AT doesn't pulse 11th clock for ACK. #661 (comment) https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol#zenith-z-150-beige
ibmpc_host_send() can miss 1st clock from Zenith Z-150 AT sometimes. #661 (comment)
TODO:
branchesmaster
Fails to set ibmpc_z150at [remove OK]
Fixed: Recover ERR:17 of reset command FF ibmpc_z150at_fix [remove OK]
Fixed:
Seems like sending 'F2' command goes successfully but there is no response from keyboard within timeout period(25ms). ibmpc_z150at_fix2 [remove OK]
Fixed: Prevent ibmpc_z150at_fix3 [
|
Zenith Z-150 AT doesn't seems to place ACK signaling normally. #661 (comment) https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol#zenith-z-150-beige IBM genuine PC host checks data line only, not clock on ACK. In this case Z-150 AT ACK signaling can be handled. http://www.halicery.com/Hardware/Intel%208042%20and%208048/8042_PS2_INTERN.TEXT (026C:) http://halicery.com/8042/8042_1503033.TXT (0274:) Place 'inhibit' on lines for long enough to cancel current state and recovery from ERROR but not sure this really helps.
This is fix for Zenith Z-150 AT. Root cause is still not clear but retrying works well somehow. #661 (comment) Add checking isr_state and line state before sending data
Fixed Start bit and ACK error. As for Start bit it needs retry and reasonable explanation of the cause is still unclear. |
Z-150 AT doesn't support F2 ID command at all and doesn't even replay with FA. https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol#zenith-z-150-at To identify the keyboard ibmpc |
Stop bit(ACK) Error on sending command
ERR:17
means error occurs after stop bit.Debug output from the converter when plugin and capslock key is pressed, tested with firmware beased on commit 19853b4 probably.
This was reported by email at 2020-11-14.
ISR:6A90
means 0xAA which received from the keyboard. The keyboard seems to reset when sending command fails withERR:17
?It seems that Zenith Z-150 is not compatible to AT protocol and it lacks 11th clock when host sends a command.
https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol#zenith-z-150-beige
Fix 1The converter doesn't wait for 11th clock after it recoginized protocol for Z-150 AT.
This should work but won't before the protocol recognition.
Commit 7e268c8
Fix 2This works as well, instead of Fix 1. Fix 1 seems to be preferable though.
When
ERR:17
happens at startup converter tries to receive response for Z-150 AT.Fix signal check for ACK
2021-05-25
Original PC/AT Keyboard Controller doesn't check clock pulse for ACK, probably Z-150 AT works with the original controller without problem. Both fixes above are not needed in the end.
With seeing ROM dump list of the keyboard controller it checks only DATA line with longer timeout on ACK. (0277, 027B)
http://halicery.com/8042/8042_1503033.TXT
Before fix:
tmk_keyboard/tmk_core/protocol/ibmpc.c
Lines 135 to 146 in 343c32a
With fix:
Z-150 AT seems to be slow for clock pulse for ACK, or no pluse at all.(Not confirmed)
Fixed repo at: 0a1dcac
2021-06-03
The text was updated successfully, but these errors were encountered: