Topics

Recompiling the ELF 2000 PS/2 AT89C2051 SW #ELF2K

taf123
 

Hi -

I'd like to use the PS/2 interface from the ELF2k in my own project, but need to tweak the AT89C2051 code a bit.

Does anyone know what compile environment was used?  I have the code from "Elf2K Full Release 6-7-2017 .zip".

Thanks,
Todd

Mark Thomas
 

Hi,

On Sun, Apr 21, 2019 at 01:43:37AM -0700, taf123 wrote:
Hi -
I'd like to use the PS/2 interface from the ELF2k in my own project,
but need to tweak the AT89C2051 code a bit.
Does anyone know what compile environment was used? I have the code
from "Elf2K Full Release 6-7-2017 .zip".
Thanks,
Todd
You must have one of the rare elf2k-GPIO cards. I have one too, but have
never seen anyone else mention them.

Upon brief inspection of the gpio folder in that ZIP file then Google,
I suggest you probably want the CA51 Compiler Kit.

Mark

--
Mark G. Thomas (Mark@...), KC3DRE

taf123
 

Thanks for info.  The CA51 kit is rather spendy for hobby use.  Anyone know of a decent Open Source environment I could use as an alternate?

I don't actually have an elf2k.  I'm building my own ELF based project, which I'll detail for the group later.

I'm currently building a CDP1869 and '70/76 based VIS (Video Interface System). Since I don't want to build a custom keyboard for use with the CDP1871 keyboard interface chip, I thought I'd use the STG PS/2 '2051 interface, connected via a CDP1852 byte-I/O chip.

I've uploaded a couple pics.  The VIS board also has room for a CDP1851 Programmable I/O Interface and a CDP1878 Dual Counter-Timer, still to come

This is working, but I'd like to be able to tweak the STG provided code a bit.

Best regards,
Todd

 

  As Mark said, it was built with the Keil C51 compiler.  This isn't free, or at least it wasn't back then, but there may be a crippled version available that can compile this project.  It's rather small.  Failing that, you might want to convert it to SDCC, which is free.

Bob

taf123
 

Thanks Bob.  There is an evaluation version of the current Keil CA51, but it does have some limitations, one of which is that the resulting code won't work in something with 2k or less space, such as the '2051, but looks like it should work for the pin compatible 4k '4051.  I'll give it a go and see how it works.

Thanks also for the tip on SDCC, I'll look into that as well.

Best regards,
Todd

ian may
 

Todd does it have to be '51 code (and perhaps ELF2K ROM compatible)? There is keyboard interfacing theory and 6805 code here:
http://aelinik.online.fr/www.beyondlogic.org/keyboard/keybrd.htm
The philosophy of that design uses the fact that holding the keyboard clock low tells the keyboard controller that it is not allowed to send data, so the interface controller is in charge. My reading of the comments in Bob's code makes me think that for his design the keyboard controller is in charge.

There is also this Atmel processor design in C  http://www.go4retro.com/products/ps2-encoder/ . A couple of years ago I built version 0.73 and found a few bugs in it. TAB and BACKSPACE were swapped, SHIFT 1 gave 1 not !, it used a delay function {_delay_us()} that avr-gcc didn't like {I changed it to __builtin_avr_delay_cycles()} and it didn't handle uninitialized eeprom very well. I see that there are now software versions 0.74 and 0.76. From a quick read of 0.76 I can see that the key mapping errors are fixed but it is still using the same delay function. I've not looked to see if the eeprom code has been changed.
Cheers, Ian.

taf123
 

Hi Ian -

This started out with me just wanting to take the existing work from the elf2k project, which works fine, and tweak it a touch for my purposes.  Plus, I had some '2051s on hand.

Of course, porting it to SDCC was a bit bigger project than I had originally planned on, but it was very interesting and educational, and fun in a nerdtastic way.

Thanks for the pointers for other options.

Best regards,
Todd

taf123
 

Hi again -

I decided in the end to go with SDCC.  There were a few things to port due to differences in how SDCC handles things, but it all works in the end.  Building the debug version works as well, but needs more than 2k of flash, so a AT89C4051 is required for that.

My main drivers for this were:
  • To change the SET_KEY_DATA_RDY strobe from active LOW to active HIGH to work directly with the CDP1852 Byte I/0 chip.
    • I enclosed these changes within #ifdef blocks so compiling with -DSTB_ACTIVE_HIGH makes the strobe active HIGH, undefined leaves it active LOW as per original elf2k
  • To support a UK layout keyboard

I made a little Makefile and a Readme which documents the changes made.  I'm attempting to attach this as gpio_sdcc.tgz to this message, please let me know if there are any problems with it.

Here's a screenshot of the debug output from the '4051 UART:



Also, here's a shot of my ELF-ish (started as an ELF, but has grown quite a bit).  The PS/2 interface is part of
a CDP1869/1876 based Video Interface System (VIS) on the upper left board.



More info on the ELF-ish in a separate thread to come.

Best regards,
Todd

ian may
 

Wow, you've got lots of hardware there Todd! It makes a change from just seeing basic ELF variations. I'm looking forward to reading more about it.
Cheers, Ian.

taf123
 

Hi -

Check out the new thread "Todd's ELF-ish", https://groups.io/g/cosmacelf/topic/31521597

Cheers,
Todd