Jump to content

Recommended Posts

Posted
27 minutes ago, COPERNICON said:

final comment on the DB25 parallel port: the computer can set pins 1,  2, 3, 4, 5, 6, 7, 8, 9 and 14, 16, 17 and can only read from 10, 11, 12 and 13 thus (theoretically) you can drive 2!!! interface A's via 1!!! DB25 parallel port!

That sounds cool!

Well I measured the current real quick - with @Bliss LEGO Blockly and my current Compis setup it was really quick:
When all 6 outputs are on and the two sensor inputs light up as well, the current in the 5V line is 35 mA. When all are out less than 2 mA are flowing.

So: You should be fine using an Arduino GPIO as emergency breaker :pir-laugh:

Best
Thorsten  

Posted

You're welcome!

BTW, the parallel port approach is well documented in this thread, as you may have seen, but only for operatioon of one Interface A. @alexGS has demonstrated that along with instructions he made. He also patched TC LOGO for the LEGO 9771 card into TC LOGO_S for serial use, as @Bliss is now pursuing with the FT's, with an Arduino as (USB) serial2parallel converter, as well as into TC LOGO_P, which runs perfectly well with a parallel (Centronics) card/port. Both inputs and outputs as well as PWM of the outputs work.

On my IBM XT, I have a 9771(+), parallel, and serial card, and all three versions of TC LOGO, the original as well as the P and S version work flawlessly, including timing and PWM.

Best
Thorsten  

Posted (edited)

i have been reading this thread for some time now (you guys are doing gods work!!!) 

the interface A working with PWM was a welcome surprise haha , i have code scraps of mine doing the same https://gitlab.com/COPERNICON/lego-interface-a-arduino-python (pardon the terrible code please)

one issue with the 2 interface A's over one parallelport is that there might not be a pin available for the 5v source, all pins are used for reading and writing the I/O of the interface A...

Edited by COPERNICON
Posted (edited)

Here is an interesting testimony on the usage of  the uniface interface cards for Lego technic programming on MSX and Philips P2000T.

https://www.circuitsonline.net/forum/view/13114?query=adc&mode=or

" Later I started working with Uniface from PTCC (Philips Home Computer Club)...

Uniface was a system that worked on almost all computers... you had a computer interface for P2000, MSX, Commondore 64/128, and PC... a ribbon cable came out of that interface to which you could attach all kinds of boards..

a printed circuit board with 8 inputs, or 8 outputs, aADC8 bits, an 8-bit (Dual) DAC, and also aADC12 bits and a 12-bit DAC... a multiplexer (so that you with 1ADCcould perform 16 measurements) and you could connect a total of 255 prints to that ribbon cable... at least almost, some cards used 2 addresses

with that system and my MSX computer and Technic Lego built a lot of little robots..."

I suspect that the "philips" MSX2 and the philips p2000T was supported by the also "philips" uniface card on the machine side and the interface A on the other side.That would explain why nobody finds the Lego official support for those machines.

 

Edited by amine
Posted
1 hour ago, amine said:

I suspect that the "philips" MSX2 and the philips p2000T was supported by the also "philips" uniface card on the machine side and the interface A on the other side.That would explain why nobody finds the Lego official support for those machines.

That'a another excellent find, @amine!

Now, I just began to read more deeply about the "MSX" computer. But MSX computers are a full range of systems adhering to an infrastructure, which is building on Microsoft Basic as operating system and thus share virtually all machine related calls, is that true? At least for the initial waves?

I also understood that "MSX" were popular in Japan/Asia, but Philips as well as many other companies were making these (diverse, but hardware-wise mostly standardized) machines?

If so, then the P2000T may actually largely follow "MSX" standards, could that be?

Wait, tin-foil hat off.

All the best
Thorsten 

Posted

Last year I borrowed an MSX computer from a friend, and I still have it, but I really don't know what to do with it. I was hoping to find its port pinouts, build a cable, and see if I could make it talk to Interface A. @Toastie this would probably be easy for you but it's not so easy for me.

Posted (edited)
39 minutes ago, evank said:

Last year I borrowed an MSX computer from a friend, and I still have it, but I really don't know what to do with it. I was hoping to find its port pinouts, build a cable, and see if I could make it talk to Interface A. @Toastie this would probably be easy for you but it's not so easy for me.

I have contacted Hans Otten he knows everything on the MSX computers

http://retro.hansotten.nl/

https://hansotten.file-hunter.com/

https://download.file-hunter.com/Technical/Hans Otten/legolift.pdf

 

https://hansotten.file-hunter.com/uploads/files/toep.pdf

He is familiar with the uniface cards but he never heard anything about the Lego interface A  support for the MSX. 

Edited by amine
Posted
51 minutes ago, evank said:

I borrowed an MSX computer from a friend

Which one exactly? Is it a Sony, Yamaha, Toshiba, Panasonic, Philips, (there are more) systems? Is it an MSX1, MSX2, MSX2+ computer? Once we know that, we can go into the MSX standardization "list" and look up any parallel port type thing.

The #1 suspect with regard to ports used is the parallel port. Cited from the MSX Wiki:

The printer connector is defined as a mandatory requirement in the MSX Standard Definition. As such almost all MSX machines have the connector, but several MSX1 computers have been released without printer port.

@evank: If you still have it, do you mind taking any photographs showing plugs, connector, sockets? And the label telling what machine it is?

As MSX computers used BASIC as operating system, PEEK and POKE seem to be the way to go? The manual for that specific MSX machine you have, should tell you the address(es) to be used when playing with the parallel port.

Best
Thorsten

40 minutes ago, amine said:

I have contacted Hans Otten he knows everything on the MSX computers

Is it "on his MSX" computer(s), or all the various MSX computers? MSX is more a standardization approach than "a computer", I believe. But standardization would work in our favor :pir-wink:

Best
Thorsten

Posted
9 minutes ago, Toastie said:

Is it "on his MSX" computer(s), or all the various MSX computers? MSX is more a standardization approach than "a computer", I believe. But standardization would work in our favor :pir-wink:

That's a good question, I have invited him on this thread  to give his opinion.

Posted (edited)
8 minutes ago, evank said:

Casio MX-101 Type B. There's also a "Flash Cart" gadget, which seems to be a modern modification for using SD cards.

 

There's some kind of card-edge sticking out the back, and there's a port on top under a removable cover: https://drive.google.com/file/d/1aGL5_xz5MBECAupxQSFOsG9dHlq8BQXb/view?usp=sharing .... presumably that's the parallel port.

 

Edited by evank
Posted (edited)
28 minutes ago, evank said:

There's some kind of card-edge sticking out the back, and there's a port on top under a removable cover: https://drive.google.com/file/d/1aGL5_xz5MBECAupxQSFOsG9dHlq8BQXb/view?usp=sharing .... presumably that's the parallel port.

 

And It has  a Japanese keyboard !

Would Dos 2.2 works on it ?

https://download.file-hunter.com/Technical/Hans Otten/msxutils/

There are plenty of programming langages available.

https://download.file-hunter.com/Program language/

 

Edited by amine
Posted
18 minutes ago, evank said:

Casio MX-101 Type B

So that would be this one: https://www.msx.org/wiki/Casio_MX-101 

It is a MSX1 system, It has a Centronics compatible parallel port, and we have the manual ... in Japanese :steve:

Well, as MSX1 is a standard, we at least know the pinout of the parallel port: https://www.msx.org/wiki/Printer_port 

Now we need the manual in English (or German :pir-laugh:).

Best
Thorsten

Posted (edited)

This is what Gemini said on first try:

To address the Centronics (printer) port in MSX BASIC, you use the standard LPRINT or LLIST commands. MSX systems route these commands directly to the parallel Centronics port by default.

Commands to Send Data

LPRINT: Sends text or variables to the Centronics port.

LPRINT "Hello World"

[1]

Advanced Bit-Banging (Direct Hardware I/O)

If you want to control the individual pins of the Centronics port manually (e.g., for custom hardware projects instead of a printer), you must address the General Instrument AY-3-8910 (PSG) sound chip. On the MSX architecture, the PSG chip's 8-bit I/O Port B is wired directly to the Centronics data lines. [1]

You control it via MSX BASIC using the SOUND register command:

Select Register 15

(System Control/Data Direction): Set Port B as output by writing 1 to bit 7.

SOUND 15, 143

Select Register 15

(Data Output): Send your 8-bit data value (0 to 255) directly to the Centronics data pins.

SOUND 15, Value

The reference [1] is the Japanese manual - Gemini know this Language, I don't.

I doubt though that register 15 is used for setting the I/O direction of the 8 outputs AND sending data - this is where the AI is maybe wrong.

But: It is very much the same on the Atari ST1040 (which uses a similar sound chip for I/O: First set the directions of the 8 I/O ports using one address, then another for actual read/write. I also saw that instead of using SOUND x,y, you may use OUT x,y.

Is all that of any interest, @evank? Then I can try to dive deeper. BASIC command OUT would need an actual address, BASIC command SOUND seems to be encoding that to addresses. 

I am just wildly guessing.

Best
Thorsten 

Edited by Toastie
Posted (edited)
12 minutes ago, amine said:

Google translated the peek command

Cool. But how PEEK and POKE work is pretty much the same across all 8-bit wonders :pir-laugh:

We need to find the section, where the manual tells us to set the direction register of the I/O (Centronics) port.

There are two possible principle ways: Z80 processors have MEMREQ lines for addressing the (64k) memory space as well as IOREQ for addressing hardware devices: When one of these lines are pulled low, the bits on the address bus talk to either memory (PEEK/POKE) or hardware (IN/OUT). I believe that the I/O chip on the MSX @evank has is I/O mapped (and not memory mapped). Otherwise the manual should say "use PEEK/POKE to read/write to the Centronics port". But instead, Gemini says use SOUND. Or IN/OUT).

This is exactly the same as in GFA BASIC on the Atari or Sinclair BASIC on the ZX Spectrum. Sinclair BASIC has PEEK/POKE as well as IN/OUT as commands.

Best
Thorsten

P.S.: They use SOUND as command, as the I/O chip in the MSX as well as in an Atari ST is a sound chip having in addition 2 I/O ports. 

Edited by Toastie
Posted (edited)

@amine COOL!!!

Now we need the register addresses of the I/O (Centronics) port! Well not true: Of the I/O chip. It should work like.

OUT io_direction_register, directions (bitwise)

and then 

OUT io_port, data - for writing to I/O ports set to output 

and 

IN io_port, data - for reading I/O ports set to input. This would require a mask, as also output lines a read-in. The mask - well just masks off output lines unsing: read data ANS mask.

Best
Thorsten

Edited by Toastie
Posted (edited)
12 minutes ago, Toastie said:

@amine COOL!!!

Now we need the register addresses of the I/O (Centronics) port!

Best
Thorsten

Ok I am looking to it 

Edited by amine
Posted

@amine

Damned - they seem to use all 14 registers for sound ... I need to look up the I/O chip.

Is there anything in the manual on I/O ports usable for external devices???

Gemini may have been confused - which I like very much. I like when an AI is confused. Well, it confuses us, but when we find out it is still kinda cool. 

Need to tune out though for now. WE WILL find this out.

All the best and thank you very much for all your effort!!!
Thorsten 

Posted (edited)

Thanks for looking into this, gentlemen!

If we collectively get it working, then I could post it on my website (and maybe as a pinned topic in the upcoming subforum here) as an example of how to directly control 9750 via MSX hardware. (Do we know any Japanese people who are into Lego and 8-bit computing?)

Edited by evank
Posted (edited)
1 hour ago, evank said:

Thanks for looking into this, gentlemen!

If we collectively get it working, then I could post it on my website (and maybe as a pinned topic in the upcoming subforum here) as an example of how to directly control 9750 via MSX hardware. (Do we know any Japanese people who are into Lego and 8-bit computing?)

Found this example in Hans Otten book

https://hansotten.file-hunter.com/uploads/files/toep.pdf

"Test Interface
This program forms the basis for all the control programs to be discussed later. It contains all the building blocks needed to develop your own control programs. The program also allows you to test the operation of the LEGO models. Please note that the program only works if the interface is connected to the computer via the printer port. When typing in the program, ensure that you do not omit the semicolon after the CHR$(B) function in the LPRINT statement within the 'Interface' module; if you forget this semicolon, the interface will not work.
The interface is controlled via BASIC using the CHR$(B) function. The variable B can take any value from 0 to 255. Each number between 0 and 255 determines which relays are energized and which are not. Logically, one might expect the decimal number zero to set all relays to their rest position. While this is effectively what happens, the interface contains two inverter ICs. These ICs, acting as buffers, convert a binary one into a binary zero and a binary zero into a binary one. Converting decimal zero to binary yields 0000 0000; after passing through the inverter ICs, this becomes 1111 1111. To set the relays to their rest position, the value 1111 1111 must be sent to the interface, which corresponds to decimal 255. For example, if you wish to activate the last relay, you must send the value 254 to the interface. Decimal 254 is binary 1111 1110; after passing through the inverters on the interface, this becomes 0000 0001. With the 'Proef-interface' program, you can send any desired bit pattern to the interface to activate one or more relays. You do this by entering the desired decimal value via the keyboard. The decimal value is displayed alongside its binary and inverted binary equivalents. Pressing function key F5 sends the value 255 to the printer port, while function key F1 exits the program

10 REM *** TRIAL INTERFACE ***
20 DIM A(7.2)
30 KEY OFF
40 GOTO 630
50 :
60 REM *** INITIALIZE ***
70 B = 255
80 H$=STRING$(37,"-")
90 KEY 1,"999"+CHR$(13)
100 KEY5,"255"+CHR$(13)
110 RETURN
120 :
130 REM *** HEAD ***
140 CLS :REM clear screen
150 PRINT "*** Trial interface ***
160 RETURN
170 :
180 REM *** OUTPUT ***
190 GQSUB 140 :BRAKE *** HEAD
200 LOCATE 2.5
210 PRINT "Entered value..:";B
220 FOR J = 1 TO 2
230 LOCATE 2.5+Y*2
240 A$ = "Bit pattern........:"
250 IF J = 1 THEN 270
260 A* = "Inverted.....:"
270 PRINT A$;
280 FOR I = 7 TO 0 STEP -1
290 PRINT CHR$(A(I,J)+48);
300 IF I MOD 2 = 0 THEN PRINT " ";
310 NEXT I
320 NEXT J
330 GOSUB 590 :REM *** INTERFACE
340 RETURN
350 :
360 REM *** BIT PATTERN ***
370 W = B : REM remember
380 FOR I = 7 TO 0 STEP -1
390 A(I,1) = O : A(I,2) = 1 : R = 2^I
400 IF W-R < 0 THEN 420
410 A(I,1)=1 : A(I,2)= 0 : W=W-R
420 NEXT I
430 RETURN
440 :
450 REM *** INPUT ***
460 LOCATE 0.18 : PRINT H$
470 LOCATE 2.20
480 PRINT "[F1] =stop"
490 PRINT " [F5] = 255"
500 LOCATE 2, 14
510 PRINT "Enter decimal value ";
520 PRINT "
530 LOCATE 24,14 : INPUT B
540 IF B = 999 THEN 560
550 IF B < 0 OR B > 255 THEN 500
560 RETURN
570 :
580 PRINT *** INTERFACE ***
590 LPRINT CHR$(B); : REM semicolon!
600 RETURN
610 :
620 REM *** CONTROL MODULE ***
630 GOSUB 70 :REM *** INIT
640 GOSUB 370 :REM *** BIT PATTERN
650 GOSUB 190 :BRAKE *** OUTPUT
660 GOSUB 460 :REM *** INPUT
670 IF B <> 999 THEN 640
680 CLS
690 END

"

Edited by amine
Posted (edited)

Once we find that memory address, then my goal would be an incredibly simple demo to prove just to prove it works: set the 6/2 pins combination for in/out, POKE the first port on/off, and PEEK/print the value of a sensor -- all in decimal 0-255, not hex.

Edited by evank
Posted
8 hours ago, evank said:

Once we find that memory address, then my goal would be an incredibly simple demo to prove just to prove it works: set the 6/2 pins combination for in/out, POKE the first port on/off, and PEEK/print the value of a sensor -- all in decimal 0-255, not hex.

That would be cool, indeed. However, I believe PEEK and POKE >may< not work, as the I/O chip for the Centronics port is probably addressed using I/O (ports) of the Z80 CPU. There are 255 such "ports" the CPU can officially address, if memory serves me right ... But as the MSX BASIC has IN/OUT, these commands may do the trick. It is exactly the same on a ZX Spectrum: This one does make use of the I/O address space of the CPU and has IN/OUT commands in its BASIC interpreter (which the ZX81 had not). These are essentially the reasons I used the I/O address(es) on the ZX Spectrum to speak with 9750, as I did not need to free any memory address(es). On the ZX81, I had to use an additional address decoder for the memory space and assign that to the I/O chip. On the Spectrum I thus used "IN/OUT port address, data" and on the ZX81 "PEEK,POKE memory address, data".

9 hours ago, amine said:

Found this example in Hans Otten book

Nice! But I believe it is the "Max Voorburg book" from 1987, scanned/OCR's by Hans Otten in 2001.

Now that is a nice and straight forward program, isn't it? Max uses LPRINT to talk directly to the Centronics port. As no initialization of the port is done, I believe LPRINT operates the port as 8x out, because the valid data range is dec 0 to 255, which are then converted to the corresponding 8-bit pattern for the "trail interface". The schematics of that interface in the book shows 8 outputs, so that assumption should be OK. 

@evank: In essence you can already use the Centronics port of the MSX to talk to the 6 outputs of Interface A; reading the inputs however still won't work, as LPRINT is "out only". You can use the very program of Max to do so, limited to the usual dec 0 to 63 (6 bit) number range. There a few errors in the listing above due to Google translate(?), but in the PDF it is all correct. The pinout of the Centronics port is also shown in the book. Do you have such a port? I don't think so? If not, Hans is using another MSX computer. Port pinouts for your machine are available on the MSX Wiki, I believe. The MSX BASIC should work on all machines. So we need to hunt further for the addresses of the I/O chip in your machine.

Best
Thorsten

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...