Previous Thread
Next Thread
Print Thread
Page 13 of 15 1 2 11 12 13 14 15
Joined: May 2009
Posts: 2,231
Likes: 402
J
Very Senior Member
Very Senior Member
J Offline
Joined: May 2009
Posts: 2,231
Likes: 402
Originally Posted by jlopezm
As far as I went, the counter is reset before I can actually use it. I have tried to "latch" it, but I can't get it to another value other than 0. Same happens with the three selection bits, they change but by when T1 is read they are reset to their default at 7...

Then latch it from the other direction. Look into PORT_CHANGED_MEMBER.

Joined: Mar 2001
Posts: 17,284
Likes: 268
R
Very Senior Member
Very Senior Member
R Online: Content
Joined: Mar 2001
Posts: 17,284
Likes: 268
Assuming a similarity to the PC/XT (commented disassembly at https://github.com/Halicery/8042/blob/main/8048_XT_INTERN.TEXT) the microcontroller tells the external circuitry when to latch the bits. On the PC/XT there are 2 latches, Q (latches the selection bits) and RESET (latches the value read from the keyboard matrix).

This is typical late 70s/early 80s IBM overengineering. Most keyboard microcontrollers do what you'd expect: set the selection bits and read live.

Joined: Dec 2017
Posts: 89
Likes: 12
J
Member
Member
J Offline
Joined: Dec 2017
Posts: 89
Likes: 12
I have been able to stabilise the values of the counter and the select signals until T1 is read. I can see them changing through the logs.

The next step is to assign the real key to the emulated one. I have been trying to assign "Reset Error" (6e) to F5 as it is the position it has in the original keyboard ("Reset error" became F5 in the transition from the Datamaster to the IBM PC) but I haven't got any reaction to the key being pressed. What would be the best way to test this?

Thank you in advance!

Joined: Aug 2009
Posts: 1,285
Likes: 222
Very Senior Member
Very Senior Member
Joined: Aug 2009
Posts: 1,285
Likes: 222
Are those inputs read as active low or active high? Wrong input pressed polarity can cause a stuck case where the host CPU believes everything is pressed and do nothing (or at best cause havoc).

Joined: Dec 2017
Posts: 89
Likes: 12
J
Member
Member
J Offline
Joined: Dec 2017
Posts: 89
Likes: 12
No, I don't think this is the issue. If there was a key pressed test 35h would fail and display the offending key's scan code.

It's like the key input at T1 was not recognised.

Joined: Mar 2001
Posts: 17,284
Likes: 268
R
Very Senior Member
Very Senior Member
R Online: Content
Joined: Mar 2001
Posts: 17,284
Likes: 268
It's somewhat common for microcontrollers to not properly detect stuck keys if that's the initial state. But add some printf()s or whatever and see if the T1 read callback is returning what you expect it to.

Joined: Dec 2017
Posts: 89
Likes: 12
J
Member
Member
J Offline
Joined: Dec 2017
Posts: 89
Likes: 12
I have successfully read keys, but the scancodes don't seem to match... I imagine I have to revise the matrix again.

EDIT:
By the way, I would like to assign the unassigned ROM space to a known value (for example 0xff). What would be the best way to so? With uninitialized memory I get some sporadic ROM errors between tests 1A and 29...

Last edited by jlopezm; 02/05/25 08:30 PM.
Joined: Apr 2012
Posts: 347
Likes: 66
Senior Member
Senior Member
Joined: Apr 2012
Posts: 347
Likes: 66
Originally Posted by jlopezm
EDIT:
By the way, I would like to assign the unassigned ROM space to a known value (for example 0xff). What would be the best way to so? With uninitialized memory I get some sporadic ROM errors between tests 1A and 29...
Replace
Code
ROM_REGION(0x24000, "maincpu", 0)
with
Code
ROM_REGION(0x24000, "maincpu", ROMREGION_ERASEFF)


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
1 member likes this: jlopezm
Joined: Dec 2017
Posts: 89
Likes: 12
J
Member
Member
J Offline
Joined: Dec 2017
Posts: 89
Likes: 12
This time I think I do require some revision by someone else. I have to revise the keyboard matrix again, but there's something that is troubling me: the scancodes generated do not match the characters I get to the screen. There's a catch, that is the verification scan codes are working fine, but when it comes to the regular ones, I even get some keys with multiple key codes...

Joined: Feb 2014
Posts: 1,220
Likes: 223
G
Very Senior Member
Very Senior Member
G Offline
Joined: Feb 2014
Posts: 1,220
Likes: 223
For those of you who have cloned jlopezm's github and are following along, to get past the startup tests you need to unset all the DIP switches except for the ones that deal with memory.

It's great to see some keystrokes working.

I haven't got time today but I'll try to figure out why the matrix isn't what we expect. (Hopefully it will stop snowing here...)

Page 13 of 15 1 2 11 12 13 14 15

Link Copied to Clipboard
Who's Online Now
1 members (AJR), 162 guests, and 1 robot.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,373
Posts122,615
Members5,085
Most Online1,529
Jun 7th, 2025
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Powered by UBB.threads™ PHP Forum Software 8.0.0