MSX Computer as USB Keyboard for several devices / machines (aka Raspberry Pi, Pc Compatible, etc)

Page 1/3
| 2 | 3

By Emic

Rookie (22)

Emic's picture

05-07-2015, 19:46

Hi everybody,

Several years ago I was working in a very cheap device that allowed any MSX Computer to work as a IBM PS/2 Keyboard using an the MSX Printer Port, the 16F684 PIC microcontroller and two simple programs , one for the PIC and one for the MSX Computer.

I've just seen a discussion in a thread about why not use our fantastic MSX Keyboards, to control another different machines; I think that is a great idea, and I think that my development could be of some use for this porpoise.

Unfortunately the original designs and programs are missing. But I still have the schematics for the 'next step' on this 'interface' , that was intended to simulate a USB Keyboard, using the MSX Computer through the printer port , and another PIC microcontroller, PIC18F4550.

The schematics are:

https://www.dropbox.com/s/wgv3szxa9anxkcx/MSXLPTUSB.jpg?dl=0

And the Board:
https://www.dropbox.com/s/9xr0o17ymxh5wig/MSXLPTUSBBOARD.jpg...

*** WARNING *** This schematics required specific Software in both MSX and PIC sides *** WARNING ***

I am still looking for the software, that I'll upload as soon as I find it.

Write you soon,

Miguel.

Login or register to post comments

By NYYRIKKI

Enlighted (5402)

NYYRIKKI's picture

06-07-2015, 05:41

I don't want to put you down in any way. This looks like an interesting example about how to interact with outside world, but for the purpose you selected... I don't think it is optimal solution...

I think that doing Joystick port <-> PS/2 port cable would be better idea... This way you don't need other components than the connectors them selfs and DB9 connectors are more easy to get than Centronix 14. -> No need for two separate programs.

MSX keyboard used this way has also some obvious drawbacks compared to native keyboard such as function-keys that go up to 5 instead of 12 like on typical PC today.

By Emic

Rookie (22)

Emic's picture

06-07-2015, 06:48

Hi! First of all, thank you for your answer.

I guess that the MSX Joystick connector would work as a full operational low rate serial connector, I remember an MSX to MSX serial communication solution using Joytickports, is this the same?

Would it work as an USB Keyboard with a standard PS2->Usb keyboard adapter? (The idea is to connect the MSX to an actual Computer or Mini Computer, such as Standard PC, Mini-PC or Raspberry-Pi, no PS2 connectors there).

Do you know, where could I find the MSX program that made the Joystick Port work as a (low rate) Serial Connector?

I think that modifying that program would made the (MSX Joystick-->PS2(USB Keyboard?) ) work Smile

And you are right, more keys on the PC --> Some keyboard configuration or mapping are required.

On the other hand, the PIC microcontroller costs about 5$, and would made all the task (and mapping) , so MSX CPU would be free for any other tasks.

Thank you again,

Miguel.

By NYYRIKKI

Enlighted (5402)

NYYRIKKI's picture

06-07-2015, 09:12

Emic wrote:

Hi! First of all, thank you for your answer.

I guess that the MSX Joystick connector would work as a full operational low rate serial connector, I remember an MSX to MSX serial communication solution using Joytickports, is this the same?

Yes, kind of... In PS/2 there is one clock line and one data line. You can use joystick pins 6 & 7 for these purposes. I've implemented this other way around (Using PS/2 keyboard as MSX keyboard) but turning the problem around should be even more easy in timing because the clock is always generated by the device (MSX in your case) so speed does not need to be quite that exactly correct. The complete version of protocol has quite a few commands to implement, but it is very well explained in here and you can probably skip quite a much of it in normal usage.

Quote:

Would it work as an USB Keyboard with a standard PS2->Usb keyboard adapter? (The idea is to connect the MSX to an actual Computer or Mini Computer, such as Standard PC, Mini-PC or Raspberry-Pi, no PS2 connectors there).

I know that there exists both active adapters and passive adapters. Active ones probably work very well, but might be harder to find. Passive ones (connecting only wires) usually rely to the keyboard it self to notice what protocol is talked to it. I would not be totally surprised if some USB chip-set could switch in to PS/2 mode as well, if such a device is connected, but this is only speculation. How ever using passive adapter at least makes it impossible to use USB hub in between.

Quote:

Do you know, where could I find the MSX program that made the Joystick Port work as a (low rate) Serial Connector?

I think you mean this JoyNet page. Programming joystick port is a bit messy because joystick port is controlled by PSG and it seems it was not planned very carefully. More details here.

By anonymous

incognito ergo sum (109)

anonymous's picture

06-07-2015, 11:50

Somebody just did it with a cartridge Smile
See it in action.

By Emic

Rookie (22)

Emic's picture

07-07-2015, 11:48

NYYRIKKI wrote:

Yes, kind of... In PS/2 there is one clock line and one data line. You can use joystick pins 6 & 7 for these purposes. I've implemented this other way around (Using PS/2 keyboard as MSX keyboard) but turning the problem around should be even more easy in timing because the clock is always generated by the device (MSX in your case) so speed does not need to be quite that exactly correct. The complete version of protocol has quite a few commands to implement, but it is very well explained in here and you can probably skip quite a much of it in normal usage.

Hey, thank you @NYYRIKKI, this contains a very complete description of the PS/2 protocol, on the other hand, is going to require a big amount of low level Z80 (PSG?) programming work , so I'm afraid I'm going to need help with this..

Quote:

Do you know, where could I find the MSX program that made the Joystick Port work as a (low rate) Serial Connector?

Quote:

I think you mean this JoyNet page. Programming joystick port is a bit messy because joystick port is controlled by PSG and it seems it was not planned very carefully. More details here.

Well, what can I say? This JoyNet page is fantastic, it's amazing how the MSX computers have been able to communicate with each other, since almost 30 years ago, using joystick ports and serial protocol!

I am going to review the sources (if available) or disassemble (hard-way) the programs, that are available for download in that page , to find how were they managing the serial communication. I think it'll be very helpful to achieve the MSX->PS2->USB interface through Joystick Ports.

Thank you!

By Emic

Rookie (22)

Emic's picture

07-07-2015, 12:05

Hi @Meits,

awesome!.

Any idea about how is this MSX Cartridge doing it? (New MSX I/O Port? / any PIC inside?? Big smile / Does it work in TurboR machines only?? )

What machine is it connected to? Is it connected to that Mini-PC on the right? The question before that: Is there a Mini-PC on the right, or is it only the Internet router (cases are now SO similar...) ??

Thank you for your post,

Miguel.

By Meits

Scribe (5661)

Meits's picture

07-07-2015, 13:21

As mentioned in the reactions on the clip, the maker has put a raspberry pi inside the cartridge and it uses the MSX as USB keyboard...
That's all I know...

By AxelStone

Prophet (2703)

AxelStone's picture

07-07-2015, 22:00

Meits wrote:

As mentioned in the reactions on the clip, the maker has put a raspberry pi inside the cartridge and it uses the MSX as USB keyboard...
That's all I know...

Not really, the cartridge doesn't include RPi, wich is connected externally. The cartridge works exclusively as USB adaptor, so functionally is the same device than Emic's one.

By Emic

Rookie (22)

Emic's picture

07-07-2015, 22:30

Hi! Thank you @AxelStone, I was writing about this at this exact moment.

So I am going to quote myself before posting the text Smile

Quote:

Hi again @Meits,

I'm sorry, I just clicked the video and it opened up, and I didn't recognize the device, as I didn't went to the youtube site itself to see it. It's described in this threat:

http://www.msx.org/forum/msx-talk/hardware/rpi2-and-msx?page=0

And here from the Spanish msx.org/es :

http://www.msx.org/es/forum/debates-en-espanol/foro-general/...

Maybe I should have wrote in the rpi2-and-msx thread, instead of opening a new one,as I have been following the Spanish threat, but I was not aware that it was in the international hardware forum as well (Sorry).

Anyway my topic is not exactly the same, as I am looking for a easy and cheap solution to achieve the same objective , that this cartridge is already doing, but using the ports that our MSX already has (Printer Port) and some extra (and cheap) hardware, or , using the Joystick Ports , and no extra hardware at all (Well , the wires and connectors, of course! )

That what I am trying to do.

I was in this exact point of my answer, when you posted yours, @AxelStone.

I don't know how expensive would it be to produce the (MSX-Keyboard-To-USB-Cartridge?) We do need a better name! Does it already has a name? , but I am afraid that is not going to be cheap.

As I liked the idea, that's why I opened this threat, trying to create a cheaper - (I am not saying better , I am saying cheaper) solution for the same problem. I think everybody then would be able to create its own interface and test its new possibilities .

Wish me luck! :) Thank you!

By NYYRIKKI

Enlighted (5402)

NYYRIKKI's picture

08-07-2015, 13:04

Emic wrote:

I am going to review the sources (if available) or disassemble (hard-way) the programs, that are available for download in that page , to find how were they managing the serial communication. I think it'll be very helpful to achieve the MSX->PS2->USB interface through Joystick Ports.

Not really... The helpful part is going to look something like this:

	; Set port
	ld	a,15		; Select PSG register 15
	out	(#A0),a		; Output to register select I/O port
	in	a,(#A2)		; Read current value of register 15
	and	%10111110	; Make sure joystick port A is selected for read & force pin 6 to 0
	out	(#A1),a		; Output to register 15

	ld	a,14		; Select PSG register 14
	out	(#A0),a		; Output to register select I/O port
	in	a,(#A2)		; Read current value of register 14
	and	%00100000	; Check status of pin 7 (Joystick port A)

This is very simple... If PSG, the connected device or both pull the pin to ground, reading it will return 0. Othervice the pin status will be "1". If you look at the PIC example in the PS/2 article and compare it to MSX joystick port pins 6 & 7 you will see that this is actually implemented same way.

For communication the alternatives that you can take after this are endless... You can make asynchronous or syncronous protocol, you can use start / stop bits, any number of bits in communication etc. You can use separate clock or ie. agree that when pin 6 status changes, it represents 0 and when pin 7 status changes, it represents 1... You can use even more pins for the communication or communicate with only one pin like you would with cassette tape.

PS/2 protocol defines, how the pins should be used in case you like to communicate with PS/2 device. Because people programming games or other link software propably didn't think about PS/2 compatibility, it is highly unlikely that you find anything usefull even if you disassemble all of the code...

It is better idea to take a look for example the PIC code that you use at the moment and port it to Z80 assembly... or simply read the definition of the protocol and turn that into code. Best way depends of question, do you read better PIC code or written definitions.

Quote:

As I liked the idea, that's why I opened this threat, trying to create a cheaper - (I am not saying better , I am saying cheaper) solution for the same problem. I think everybody then would be able to create its own interface and test its new possibilities .

Ok, then I think that doing this software driver would definitely be the cheapest - (I am not saying most easy, but cheapest) solution. Smile

Page 1/3
| 2 | 3