Login
Forum Help



Post Your Message
="hidden" name="cat" value="Hardware">
Username: (Login)

Topic:
Message:
 


Previous Messages
Posted By

SukkoPera
on 2025-05-15
03:17:25
 Re: Common User Port Peripherals vs MOS 6529 replacement

OK, so I think the code above would work on the +4 as-is, except for the 2 modifications I already pointed out.
Posted By

MMS
on 2025-05-14
16:32:55
 Re: Common User Port Peripherals vs MOS 6529 replacement

yeah, to make it clear the C64 program and the Interface A shows the particcular bits are outputs of the paralell interface part of the user port.
Would have been great if the CIA/TIA and ACIA programming and initalization would be the same, but I suppose I would ask too much :-)

Certainly one bit can control the DC motor's one direction, the other directinon in an other bit.
So a plotter needs 4 bits for the 4 directions of the 2 motors and 2 bits for the pen up and pen down.

@SukkoPera: yes, because to User Port cable the bits are fixed, the two upper one is input (for sensors) the lower six is output (mainly for light amd motors)



This is the C64 control SW (LEGOLines) UI (pretty slow loading):
Posted By

Andras
on 2025-05-12
10:44:47
 Re: Common User Port Peripherals vs MOS 6529 replacement

@SukkoPera thank you
Posted By

SukkoPera
on 2025-05-15
03:17:45
 Re: Common User Port Peripherals vs MOS 6529 replacement

The userport has a parallel port and a serial port.

The parallel port is 8-bit wide, every bit can be used independently as an input or an output. The C64 code that was pasted above uses a similar feature of the C64 userport, and apparently it configures bits 0-5 as outputs and 6, 7 as inputs. I don't know if this configuration is mandatory for the Lego interface or not.

Anyway in this case you have up to 64 different states, what you do with those is up to your program. Before you start coding I would suggest you to make a table on paper of what the value of every bit should be for every state of your program, then things will be clearer.
Posted By

Andras
on 2025-05-12
09:57:27
 Re: Common User Port Peripherals vs MOS 6529 replacement

@SukkoPera Last question for now. If we want a @MMS five-axis robot, then there are 3 states per axis: left, right, stop. In this case, the Poke64784 takes a total of 15 values? 0-14? And how does the User port physically control this? Is there enough space to connect the 5 servo motors?
Posted By

SukkoPera
on 2025-05-12
09:33:32
 Re: Common User Port Peripherals vs MOS 6529 replacement

I don't think it's anything. I just assumed the code wanted to read/write to the userport but you are right, it makes no sense.

Master!?!?!?!?!?!? No way!
Posted By

Andras
on 2025-05-12
09:10:56
 Re: Common User Port Peripherals vs MOS 6529 replacement

@SukkoPera Thank you master. What is Poke65281 on C64? I can't find it on the internet
Posted By

SukkoPera
on 2025-05-12
08:42:54
 Re: Common User Port Peripherals vs MOS 6529 replacement

On the C64 maybe, on the +4 no, you need to replace 65280 and 65281 with 64784 (which is DEC("FD10")), it's the only register that you should use to interact with the parallel part of the userport.

But in both cases the PEEK line does not seem correct to me, as apparently you can only read the top two bits.
Posted By

Andras
on 2025-05-12
08:36:06
 Re: Common User Port Peripherals vs MOS 6529 replacement

@Sukkopera:
Getkey A$
If a$="f" then poke 65280,3:rem forward
If a$="L"then poke 65280,1:rem left
If a$="R" then poke 65280,2:rem right
If a$="s" then poke 65280,0:rem stop
If peek(65281)<10 then goto right line because collosion detected above 10cm
This program is correct?
Posted By

SukkoPera
on 2025-05-12
08:15:10
 Re: Common User Port Peripherals vs MOS 6529 replacement

It's not necessary: just set P=DEC("FD10") at line 10000 and replace line 10010 with POKE P, 192, it should work.

(But wiring needs to be different, of course.)
Posted By

Andras
on 2025-05-12
08:07:17
 Re: Common User Port Peripherals vs MOS 6529 replacement

@SukkoPera the poke65280,1-3 and 65281 be used for this task?
Posted By

SukkoPera
on 2025-05-12
04:20:32
 Re: Common User Port Peripherals vs MOS 6529 replacement

It's all good happy: All I meant was that this code looks pretty simple, if we know how the Lego thingie works we could just write it from scratch, no need to port C64 code. It can be done with the +4's native userport alone.

It's a nice project, keep it up! happy
Posted By

MMS
on 2025-05-11
13:02:03
 Re: Common User Port Peripherals vs MOS 6529 replacement

@Sukkopera: maybe I do not understand well the concept, but I am not sure why I would send complete data here.

The aim is to communicate with sensors and control motors (not servo motors, but DC motors), for that one only 1-1 bit is used (AFAIS), works as the amplifier for the User port specific output, like what you need to build yourslef based on the Data Becker's book "C64 and the Robots"

www.youtube.com/watch?v=xLENEktsZdQ

https://lukazi.blogspot.com/2014/07/lego-legos-first-programmable-product.html
Posted By

SukkoPera
on 2025-05-11
08:03:44
 Re: Common User Port Peripherals vs MOS 6529 replacement

As I have already mentioned elsewhere, I am somewhat surprised that this value had to be changed, but in any case I don't think it will create any problems.

@MMS: That doesn't seem particularly clever, it's just using the 8-bit parallel port and the code allows setting/clearing one bit, it is trivial to port to the +4, I can help if you want. Problems start when you want to transfer 8 bits and you need a "data valid" signal: the CIA/VIA have the handshake lines for that, here we have nothing and we have to make creative use of the serial signals, or transfer only 7 bits and reserve one for handshaking.

... Which brings to mind that another peripheral that could expose problems on the userport is my wireless interface card, which I haven't released yet (and I'm almost certain I'll go another route) but I have tested it on L16 V4 with a '654 and it worked wonders.
Posted By

MMS
on 2025-05-11
06:12:05
 Re: Common User Port Peripherals vs MOS 6529 replacement

well, it is funny, because together with Andras we found out, that there is a good way to use the User Port, we jst need to convert this LEGO cable made for C64. I do not think it would be impacted by the level too much.



And it can link to LEGO Technic Interface A


This is a code from "lego_c64_manual_basic_comal.pdf", how to initiate the Interface A
Posted By

siz
on 2025-05-09
15:18:09
 Re: Common User Port Peripherals vs MOS 6529 replacement

@GreatWhiteRetro : things that come to my mind: 1541 parallel cable, Centronics printer cable, some EPROM-burners, Wheel-of-Joy, Wheel-of-Joy mini, some MIDI adapter
Posted By

bszggg
on 2025-05-08
17:54:56
 Re: Common User Port Peripherals vs MOS 6529 replacement

I'm working on a card that is use the 6529.
In the card side is a raspberry pi pico 2w, with open collector mode.
As I think if you use the 2.2k instead of 8k, it means a little bigger amps current. I don't know the pi works or not with it, but it will be good to work with it.
Posted By

GreatWhiteRetro
on 2025-05-08
09:08:29
 Common User Port Peripherals vs MOS 6529 replacement

Aside from plus/4 modems that would make use of the UART and inverters, and the SNES adapters out there, what other user port devices would be out there that make use of the parallel I/O pins?

I had trouble with the LittleSixteen v4's user port and TexElec's SNES adapter when using a 74x654 part instead of a MOS 6529 part. Some of the controller buttons wouldn't respond as expected.

The x654 parts needed a pullup resistor pack to maintain compatibility with the MOS 6529. I had to replace this resistor pack with a 2.2k version to make the TexElec adapter behave correctly.
https://github.com/SukkoPera/LittleSixteen/issues/23

I believe this issue with the TexElec adapter is resolved, but I wanted to know if there were other user port devices out there that would be adversely affected by using a 2.2k RP instead of the specified 8k RP.

A similar comparison on a stock plus/4 would be replacing the MOS 6529 with this replacement, but replacing all of the surface mount resistors with 2.2k versions.
https://www.sellmyretro.com/offer/details/43923

Copyright © Plus/4 World Team, 2001-2025. Support Plus/4 World on Patreon