VOGONS


First post, by HanJammer

User metadata
Rank Oldbie
Rank
Oldbie

Failing 8042 KBC is a common issue on 286 and 386 motherboards… I used to buy broken motherboards and if they were beyond repair - they were a good source for these chips... anyway - 'blank' 8042s are readly available and cheaper too (not to mention I'm not a guy who breaks one repairable thing to fix another), the problem is they need keyboard "BIOS" to work as KBC and I have no idea how to program them. I found this site http://devster.monkeeh.com/z80/upi42/ some time ago, but it's a bit chaotic… I would rather program them just like atmel microcontrollers - ideally using my TL866... it would also be nice to have an archive for keyboard "BIOSes" (although I think they are interchangeable).

Any idea how to do this?

New items (October/November 2022) -> My Items for Sale
I8v8PGb.jpg

Reply 1 of 14, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Hi, I believe that's a common issue. The intel i8042 / i8048 aka MCS 48 (along with i8051/52) series are one of the earliest microcontroller chips.
For example, the i8052 also had a variant called 8052AH-BASIC, which was a stand-alone computer-in-a-chip running BASIC.
It could be controlled by a serial terminal and supported interrupts, even! 😁

Programming the old intel microcontrollers isn't exactly easy, but also not very hard.
To program something like a P8042AH, it just requires a supported programmer, such as the Willem.
Or an adapter board. Have a look for "MCS-48 adapter". Maybe there's one for your programmer, too.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 2 of 14, by Deksor

User metadata
Rank l33t
Rank
l33t

You also need the Keyboard controller's ROM, where can we find that nowadays ?

Trying to identify old hardware ? Visit The retro web - Project's thread The Retro Web project - a stason.org/TH99 alternative

Reply 3 of 14, by HanJammer

User metadata
Rank Oldbie
Rank
Oldbie

Well I see this is the bigger problem than I thought - if there is no 'common' knowledge how to program them cheaply (Willem programmes are costly, and TL866 doesn't support for MCS-48 for now) and there are no ROM images with keyboard BIOSes (although It should be rather easy to reproduce) then in a few years we will have trouble finding replacement KBC 8042s..

New items (October/November 2022) -> My Items for Sale
I8v8PGb.jpg

Reply 4 of 14, by Deksor

User metadata
Rank l33t
Rank
l33t

Well now that you mention reproduce the code, maybe reproducing its behavior with another readily available controller could be made ?
You mentioned atmel microcontrollers, maybe the behavior can be reproduced with one of these and then a adapter PCB could be made in order to fit this into the i8042's place ?

Trying to identify old hardware ? Visit The retro web - Project's thread The Retro Web project - a stason.org/TH99 alternative

Reply 5 of 14, by Tronix

User metadata
Rank Member
Rank
Member

This document may be useful: http://www.halicery.com/8042/8042_1503033.TXT
Also, google "1503033.bin" for download raw binary dump
Home-made programmer: https://www.eevblog.com/forum/microcontroller … icrocontroller/

Deksor wrote:

Well now that you mention reproduce the code, maybe reproducing its behavior with another readily available controller could be made ?
You mentioned atmel microcontrollers, maybe the behavior can be reproduced with one of these and then a adapter PCB could be made in order to fit this into the i8042's place ?

Atmel's 8051 is the closest relative, but their pinout is completely different, except for VCC and GND. Another microcontrollers from Atmel - AVR dosn't have parallel slave bus, plus have different pins for VCC and GND. PIC microcontrollers from Microchip have "parrallel slave port", but also pinout is complectly different from 8042.

https://github.com/Tronix286/

Reply 6 of 14, by retardware

User metadata
Rank Oldbie
Rank
Oldbie
Tronix wrote:

Highly interesting!
By the way, the inner workings and the technical issues that appear with "Legacy Keyboard support" are in-depth discussed on OSDEV wiki article, which can be useful to in-depth understand whats happening there.

Reply 7 of 14, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

VIA has a hardwired version of 8042 KBC direct replacement - VT82C42, such that one no longer has to worry about the OTP ROM code. It claims to be compatible with IBM/Phoenix/AMI KBC protocols including the PS/2 standard.

Reply 8 of 14, by HanJammer

User metadata
Rank Oldbie
Rank
Oldbie
Tronix wrote:

This document may be useful: http://www.halicery.com/8042/8042_1503033.TXT
Also, google "1503033.bin" for download raw binary dump
Home-made programmer: https://www.eevblog.com/forum/microcontroller … icrocontroller/

I've seen this thread, somehow I missed the bin though… that's definitely an option.

kjliew wrote:

VIA has a hardwired version of 8042 KBC direct replacement - VT82C42, such that one no longer has to worry about the OTP ROM code. It claims to be compatible with IBM/Phoenix/AMI KBC protocols including the PS/2 standard.

So it's a direct replacement without need of programming (already programmed as KBC)? Great news.
I will order some from utsource then and test it in my 286/386 mobos… Perhaps I will even find some motherboard with this chip installed. I think I've seen them on MVP3 Super Socket 7 motherboards and maybe some later as well.

New items (October/November 2022) -> My Items for Sale
I8v8PGb.jpg

Reply 9 of 14, by Jo22

User metadata
Rank l33t++
Rank
l33t++

interesting. Just please note that some user down the blog said that the transistors were drawn upside-down, so better double check the circuit. 😀

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 10 of 14, by Jo22

User metadata
Rank l33t++
Rank
l33t++

The MCS-48 family also supported external EPROMs, so maybe an alternate design could use an 27Cxxx EPROM instead of internal storage.

I've also found an intersting document, explaining the history of the chip family. 😀

https://www.dos4ever.com/8031board/history8051.pdf
Source: https://www.dos4ever.com/8031board/8031board.html

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 11 of 14, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Now that's a surprise! At some point, the old Genius mice also had got an 8042 derivative inside. Haven't expected that.

Attachments

  • genius_8048.jpg
    Filename
    genius_8048.jpg
    File size
    389.84 KiB
    Views
    1571 views
    File license
    Fair use/fair dealing exception

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 12 of 14, by Jo22

User metadata
Rank l33t++
Rank
l33t++

By the way, some of the modern 805x/875x are pin compatible with their MCS-51 ancestors and contain internal EEPROM/Flash-ROM.
These can be used with USB programmers such as the G540, for example.

- I'm currently trying to program one of these (AT89C51RB2 series w/ 1KiB XRAM, 16-32KiB Flash, 256 Bytes Scratch Pad RAM),
so it could act as a replacement for my 8052AH-BASIC chip (these are really rare nowadays).

So maybe there's also a chance to "port" an 8042 Keyboard-Controller to the
later generations, not sure. I'm just starting to understand this platform. 😅

PS: Also interesting:
http://www.theresistornetwork.com/2013/07/pro … tel-mcs-48.html
http://www.cpushack.com/Historyofthe8051.html

Attachments

  • mcs-51_g540.jpg
    Filename
    mcs-51_g540.jpg
    File size
    35.68 KiB
    Views
    1565 views
    File license
    Fair use/fair dealing exception

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 13 of 14, by SirNickity

User metadata
Rank Oldbie
Rank
Oldbie

I wouldn't worry about pin compatibility. Just make an adapter PCB with a surface-mount micro that has the necessary IO.

It's kind of a long-term project of mine to re-implement everything on an XT / AT motherboard from scratch, up to the CPU itself. No idea how far I'll get before I lose interest, but I'm almost done with the PS2 interface. Hardware layer is done, but as yet untested. KB protocol layer is in the works now - a day or two probably. Next up: XT. I'm writing it in C with user-provided function pointers for the hardware interface (IO port manipulation, interrupt management, etc.) so I can easily compile it for different platforms, but AVR is my platform du jour, or ARM Cortex M when I need more brawn.

Reply 14 of 14, by tony359

User metadata
Rank Member
Rank
Member

Hi there

Resuming this old post. Any updates on this interesting subject?

I think I have a partly faulty 8042 - it works for a while then the keyboard stops working - and it seems that the MB's BIOS only likes that controller.
Is there any changes in 2021 to extract the programming - reprogram another chip? I do have a TL866.

Thanks!

My Youtube channel: https://www.youtube.com/@tony359