Announcing availability of a QLNET driver for the Q68 (ND-Q68)

Anything QL Software or Programming Related.
Post Reply
martyn_hill
Aurora
Posts: 908
Joined: Sat Oct 25, 2014 9:53 am

Announcing availability of a QLNET driver for the Q68 (ND-Q68)

Post by martyn_hill »

On this Father's Day (in the UK, anyway), I am pleased to announce the availability of driver software that allows you to finally network the Q68 with other QL-compatible machines via the standard QLNET ports. The ready-to-run driver as well as the source code are attached below and I'll call upon Dilwyn's services in due course to upload to the Q68 page of the QL Homepage repository.

There are no QDOS EXECutables in the attached ZIP package, so you are safe to extract the contents on a PC/Mac/*nix before importing on to an SD-Card ready to run on your Q68; you'll only need the single binary file "ndq68_dvr_v305" - unless you also fancy perusing the (heavily commented) source code.

Whilst Peter designed the Q68 with the digital-side of a QL-compatible network port, the Q68 will need a small and simple HW modification to add the required couple of resistors, 3.3v Schottky diode and the 3.5mm Jack socket(s) to allow physical attachment to the QLNET. I'll follow-up this post with some details in the coming weeks, but for the impatient solderers out there, you can find a simple schematic in an earlier post on this forum or else in a PDF available from the German QL Forum here:

http://forum.tlienhard.com/phpBB3/downl ... hp?id=8551

If you do decide to make this mod yourself, do take care not to brick your lovely Q68 - it's very tight in there and remember that it runs at 3.3v (hence the absolute need for the diode)...

The driver (ND-Q68) is based off the latest published QLNET driver source as included with SMSQE/TK2 - and is fully compatible, providing all the same features including the really useful FSERVE network server and client functionality. ND-Q68 has been tested successfully on both SMSQE (v3.34) and Minerva v1.98 (with MK's I/O fix) on the Q68 and can be loaded with a simple LRESPR or equivalent. You should be fine with any recent version of either OS (as available for the Q68.)

Two additional S*Basic FNs have been added - NET% returns the current Network Node number assigned to this host (with the standard NET procedure) and NET_VER$ returns the driver version - "v3.05" as of today's release.

The driver was re-designed to make use of the Q68's 40MHz counter/timer register and thus runs independently of the Q68's (optimised) 68k instruction cycle-timings; all earlier network drivers were devised to be dependent upon the clock and instruction-timings of their respective hosts (QL, SGC, QXL, etc) using simple, software-based loops - and cross-platform compatibility tended to suffer as a result.

In order to ensure consistent timings even on the Q68, the driver automatically copies about 2kB of its code in to the Q68's uncontended 'Fast Memory' during initiaisation - I borrowed an idea from Marcel's TK2 network 'split-code' approach to link the logical and (timing-critical) physical segments, albeit in a slightly different and extended way. Take care then if you already use the Fast Memory area of the Q68 as it may clash with this driver.

One outcome of the use of the constant 40MHz timer-tick and the Q68's uncontended SRAM is that the network timings more precisely match TT's original specifications and, as a result, ND-Q68 proves to be more tolerant of the timing vagaries of other connected QLNET nodes. In fact, ND-Q68 can even communicate reliably in both directions with a Spectrum/Interface-1 - as far as I'm aware, something not seen before between QL and Spectrum :-)

ND-Q68 was successfully tested alongside QLs (with TK2 in ROM or uncontended RAM), QL+SGC (Tetroid) and a QXL. The Q68 was able to communicate with nodes that couldn't reliably talk to one-another. Aside from the network 'Broadcast' function (which was re-designed for TK2), you should find that even without TK2 loaded, a Minerva or QDOS equipped QL will communicate with the Q68 at a basic level too.

Furthermore, given the Q68's reliable, high-speed SERial port, Peter has also already had some success running ND-Q68 alongside the brilliant SERNET driver, allowing the Q68 to act as a 'bridge' between those nodes with real QLNET ports and other machines such as the Q40/Q60 and emulated QLs running at up to 115,200 Baud.

I've got further plans for ND-Q68 (v3.06 is already brewing...) as well as the respective network drivers on our humble QLs and emulators, but would welcome feedback on use of ND-Q68 in the 'real-world' in the meantime.

May I offer my personal thanks to Peter for bringing us the Q68, Wolfgang for his patient tuition and guidance on assembling from the SMSQE source code and Jan B for Minerva4Q68. Of course, one mustn't forget the original genius of TT, the QView team and all those involved in developing what was and is a truly effective and robust network capability (with the right hardware, at least) - way back in the mid-eighties and all in less than 6kB!

I'm happy to field and attempt to answer questions about the driver here, but do remember that in true open-source fashion, you have the source code available to study and modify/improve upon as you see fit - it was a labour of love, but it's yours now :-)

Happy QL-Networking!
Attachments
ndq68_v305.zip
(55.59 KiB) Downloaded 245 times
Last edited by martyn_hill on Thu Jun 20, 2019 7:30 pm, edited 1 time in total.


thorsinclair
Trump Card
Posts: 198
Joined: Mon Jan 10, 2011 5:08 pm

Re: Announcing availability of a QLNET driver for the Q68 (ND-Q68)

Post by thorsinclair »

Congratulations & thank you very much!


User avatar
Pr0f
QL Wafer Drive
Posts: 1297
Joined: Thu Oct 12, 2017 9:54 am

Re: Announcing availability of a QLNET driver for the Q68 (ND-Q68)

Post by Pr0f »

Awesome work - I may steal the timer idea to get QL networking driver written for the propeller if you don't mind?


User avatar
Dave
SandySuperQDave
Posts: 2765
Joined: Sat Jan 22, 2011 6:52 am
Location: Austin, TX
Contact:

Re: Announcing availability of a QLNET driver for the Q68 (ND-Q68)

Post by Dave »

This is fantastic.

Also, pr0f... Propeller driver? Do tell!


User avatar
dilwyn
Mr QL
Posts: 2750
Joined: Wed Dec 01, 2010 10:39 pm

Re: Announcing availability of a QLNET driver for the Q68 (ND-Q68)

Post by dilwyn »

martyn_hill wrote:On this Father's Day (in the UK, anyway), I am pleased to announce the availability of driver software that allows you to finally network the Q68 with other QL-compatible machines via the standard QLNET ports. The ready-to-run driver as well as the source code are attached below and I'll call upon Dilwyn's services in due course to upload to the Q68 page of the QL Homepage repository.
Well done Martyn. I'll be pleased to add it when you're ready.


User avatar
Pr0f
QL Wafer Drive
Posts: 1297
Joined: Thu Oct 12, 2017 9:54 am

Re: Announcing availability of a QLNET driver for the Q68 (ND-Q68)

Post by Pr0f »

Dave wrote:This is fantastic.

Also, pr0f... Propeller driver? Do tell!
Early doors project to provide a spin program to handle QL / Spectrum network - it was part of my IPC replacement idea, but it could be used standalone to make a networked peripheral for instance...


martyn_hill
Aurora
Posts: 908
Joined: Sat Oct 25, 2014 9:53 am

Re: Announcing availability of a QLNET driver for the Q68 (ND-Q68)

Post by martyn_hill »

Hi Dilwyn!
dilwyn wrote:Well done Martyn. I'll be pleased to add it when you're ready.
As soon as you like, thank you! The zip-file attachment to the original post is all that is needed, perhaps with a 2-liner comment:

"ND-Q68 is a new driver for the Q68 to allow networking with QL-compatible devices over the standard QL/ZX Network ports. A small hardware modification is required to the Q68 to allow attachment to the network via 1 or 2 3.5mm jack socket(s). A simple schematic is available at the German QL Forum to make this modification: http://forum.tlienhard.com/phpBB3/downl ... hp?id=8551.
Once loaded, the driver provides all the same features as the enhanced TK2 QL Network driver, upon which ND-Q68 is based - including the FSERVE client/server. Any existing user-documentation for the TK2 QLNET device is therefore applicable to ND-Q68."

Is that enough, do you reckon?

Thanks in advance for your ever-present support for the QL community, Dilwyn!
Last edited by martyn_hill on Mon Jun 17, 2019 1:20 pm, edited 1 time in total.


martyn_hill
Aurora
Posts: 908
Joined: Sat Oct 25, 2014 9:53 am

Re: Announcing availability of a QLNET driver for the Q68 (ND-Q68)

Post by martyn_hill »

Hi Pr0f!
Pr0f wrote:Awesome work - I may steal the timer idea to get QL networking driver written for the propeller if you don't mind?
It 'aint stealing when it's given freely!

In the provided source-code, you'll find a bunch of 'timer-primitives' fully commented towards the end of 'dd_nd_q68_phys_asm' - just before the Broadcast Receive routine (ndfm_bcast) commences.

There is a bit more to do to ensure correct timings on Q68 - happy to take that off-line or in a separate thread if you like...

When any new QL-compatible replacement is designed, I would strongly recommend adding a simple high-precision timer like Peter wisely thought to include in Q68 - it overcomes all those difficulties associated with trying to maintain tight-timings in software based purely on instruction cycle-times! Of course, off-loading such I/O to dedicated hardware is another valid approach :-)


User avatar
Peter
QL Wafer Drive
Posts: 1949
Joined: Sat Jan 22, 2011 8:47 am

Re: Announcing availability of a QLNET driver for the Q68 (ND-Q68)

Post by Peter »

martyn_hill wrote:May I offer my personal thanks to Peter for bringing us the Q68, Wolfgang for his patient tuition and guidance on assembling from the SMSQE source code and Jan B for Minerva4Q68.
Thanks back to you Martyn, you did a fantastic job! :D

At Q68 design time, the likelihood for this software development did not look very high - that's why only the digital side of QLNET is on the board.
I know that adding a few external parts is not ideal, but something I hope the QL community can handle.

At the moment, I have no general recommendation where to place/solder the 3.5 mm jack socket(s), resistors and clamp diode.
User ideas, pictures and examples are welcome. (Probably a hardware forum topic.)


User avatar
Pr0f
QL Wafer Drive
Posts: 1297
Joined: Thu Oct 12, 2017 9:54 am

Re: Announcing availability of a QLNET driver for the Q68 (ND-Q68)

Post by Pr0f »

martyn_hill wrote:Hi Pr0f!
Pr0f wrote:Awesome work - I may steal the timer idea to get QL networking driver written for the propeller if you don't mind?
It 'aint stealing when it's given freely!

In the provided source-code, you'll find a bunch of 'timer-primitives' fully commented towards the end of 'dd_nd_q68_phys_asm' - just before the Broadcast Receive routine (ndfm_bcast) commences.

There is a bit more to do to ensure correct timings on Q68 - happy to take that off-line or in a separate thread if you like...

When any new QL-compatible replacement is designed, I would strongly recommend adding a simple high-precision timer like Peter wisely thought to include in Q68 - it overcomes all those difficulties associated with trying to maintain tight-timings in software based purely on instruction cycle-times! Of course, off-loading such I/O to dedicated hardware is another valid approach :-)
The propeller has several timers on board plus access to the cpu clock timer. Also useful is a wait on I/O port which could be used to trap for the start of a sequence on the network :-) I believe the Inteface 1 used something similar. So with the timing routines it should be possible to read the QL network quite accurately. I could dedicate a cog to just reading the network and stuffing a buffer in the shared memory for other cogs to process.


Post Reply