Simple DMA example

Do you live and breathe hexadecimal? Do you like speaking to hardware directly?

Moderator: Programming Moderators

User avatar
gavin1969
Posts: 6
Joined: Sun Jul 16, 2017 8:20 pm

Re: Simple DMA example

Post by gavin1969 » Tue May 08, 2018 3:49 pm

Sorry for the cheeky request, but I was wondering if SevenFFF might be willing to post another thread explaining how to get the ParaSys stuff working with Zeus?
This sounds similar to how the P.D.S. system used to work back in the day, and it would be great to be able to compile on PC and send across to the Speccy Next while experimenting, might save many previous hours!
I've had a look on the DesignDesign page, but don't see any specific instructions for setting up ParaSys (with or without a Spectrum Next).
I'm too worried about damaging my precious devboard to go randomly connecting cables without being sure of correct pins etc.

Any help on the subject would be greatly appreciated! Thanks! :)

User avatar
SevenFFF
Posts: 211
Joined: Mon Jun 05, 2017 5:30 pm
Location: USA

Re: Simple DMA example

Post by SevenFFF » Tue May 08, 2018 4:36 pm

I will do, no problem. Later today :)
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel Spectron 2084blog

User avatar
KevB
Posts: 57
Joined: Tue Dec 19, 2017 6:34 pm
Location: Yorkshire, United Kingdom
Contact:

Re: Simple DMA example

Post by KevB » Tue May 08, 2018 5:58 pm

gavin1969 wrote:
Tue May 08, 2018 3:49 pm
This sounds similar to how the P.D.S. system used to work back in the day, and it would be great to be able to compile on PC and send across to the Speccy Next while experimenting, might save many previous hours!
Good old PDS!
PDS wired for Amiga Parellel Port.jpg
PDS wired for Amiga Parellel Port.jpg (761.29 KiB) Viewed 1133 times
I've been using a Windows command line tool (NX232) to serial download to the TBBlue 2A since Boxing Day 2017. I was using PDS v2 Z80 to build my Next code but it was too buggy to handle my projects so I switched to using my own Windows command line assembler (NXASM). You're in for a treat if you can get cross-development working on the Next :)

It helped me develop and debug my own DMA code !!!
TBBlue 2A Serial Link.jpg
TBBlue 2A Serial Link.jpg (691.78 KiB) Viewed 1133 times
I do miss the debugger I had with the Megadrive development hardware though. These three machines are so similar ;)
PSY-Q Megadrive.jpg
PSY-Q Megadrive.jpg (741.37 KiB) Viewed 1129 times
128K+, +2, +3, MF3, TBBlue 2A (2MB). ZX Spectrum fan since 1985. Next developer https://twitter.com/9bitcolor :: http://www.9bitcolor.com/

User avatar
SevenFFF
Posts: 211
Joined: Mon Jun 05, 2017 5:30 pm
Location: USA

Re: Simple DMA example

Post by SevenFFF » Tue May 08, 2018 6:09 pm

Nice one Kev. Have you made the jump to 2meg baud yet? Available on the .31 dev core. More details when I write up ParaSys.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel Spectron 2084blog

User avatar
KevB
Posts: 57
Joined: Tue Dec 19, 2017 6:34 pm
Location: Yorkshire, United Kingdom
Contact:

Re: Simple DMA example

Post by KevB » Tue May 08, 2018 6:17 pm

SevenFFF wrote:
Tue May 08, 2018 6:09 pm
Nice one Kev. Have you made the jump to 2meg baud yet? Available on the .31 dev core. More details when I write up ParaSys.
I'm still on the older firmware so I'm running at 115,200. I'll deal with that upgrade when it becomes public as I'm in no rush. I've been very happy with that speed so far. What is ParaSys btw ?

EDIT:

This gem of info is relevant to this post. Cross-development revealed strange DMA behavior on the Next when the registers were not set correctly or in the right order. For example, I had an issue where memory paged in at location 0 was wiped. I put it down to the DMA starting before the register setup was complete. Hope this helps.
Last edited by KevB on Tue May 08, 2018 6:27 pm, edited 1 time in total.
128K+, +2, +3, MF3, TBBlue 2A (2MB). ZX Spectrum fan since 1985. Next developer https://twitter.com/9bitcolor :: http://www.9bitcolor.com/

User avatar
SevenFFF
Posts: 211
Joined: Mon Jun 05, 2017 5:30 pm
Location: USA

Re: Simple DMA example

Post by SevenFFF » Tue May 08, 2018 6:26 pm

It shouldn't be too much longer for that to be released, hopefully.

ParaSys is Simon Brattel's version of PDS. He wrote Halls of the Things et al on a homebrew Z80 machine interfaced with a Speccy, back in the day.

There's been some caution about the higher speeds, as the smaller margin of error can cause 8N1 comms to drift out of sync. But I'm having great success and reliability with a 6 foot 3.3v FTDI USB cable, and a 100pf cap across RX and GND, at 2,000,000 baud. Connected exactly as you have yours, at the board end.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel Spectron 2084blog

User avatar
KevB
Posts: 57
Joined: Tue Dec 19, 2017 6:34 pm
Location: Yorkshire, United Kingdom
Contact:

Re: Simple DMA example

Post by KevB » Tue May 08, 2018 6:33 pm

Thanks for that Robin. I think I saw something a while ago on the Facebook group connected with Simon Brattel.

Drift is one of the reasons I am putting off upgrading my RS232 link. I might have to split the data in to packets and resend them if they fail. I wont know until I sit down with the newer firmware and run some tests.
128K+, +2, +3, MF3, TBBlue 2A (2MB). ZX Spectrum fan since 1985. Next developer https://twitter.com/9bitcolor :: http://www.9bitcolor.com/

User avatar
SevenFFF
Posts: 211
Joined: Mon Jun 05, 2017 5:30 pm
Location: USA

Re: Simple DMA example

Post by SevenFFF » Tue May 08, 2018 6:41 pm

Oh no, that sucks.

Here is Tim's preliminary documentation, if you want to mull it over.

If you're not running on video timings 0, 1 or 7, that could be the culprit. The new system allows more precise calibration with the prescalar, whatever the speed. Bottom section of the document.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel Spectron 2084blog

User avatar
KevB
Posts: 57
Joined: Tue Dec 19, 2017 6:34 pm
Location: Yorkshire, United Kingdom
Contact:

Re: Simple DMA example

Post by KevB » Tue May 08, 2018 6:59 pm

Thanks for the UART info. I think I'm on standard VGA timings (2). My head is in NextPaint at the moment. I think it will be a while before I upgrade as the next project for the Next (lol) will be the code to display the map data from NextPaint.

EDIT: The UART is my life line!
128K+, +2, +3, MF3, TBBlue 2A (2MB). ZX Spectrum fan since 1985. Next developer https://twitter.com/9bitcolor :: http://www.9bitcolor.com/

User avatar
SevenFFF
Posts: 211
Joined: Mon Jun 05, 2017 5:30 pm
Location: USA

Re: Simple DMA example

Post by SevenFFF » Tue May 08, 2018 7:12 pm

Yes, for sure. You will definitely need to make a small change to your slave at the point you upgrade, even if you keep at 115,200, so avoid until you are ready.

BTW timing 2 is actually 51Hz, although it is the default in the distribution configs. I got vastly better graphics when I got timing 1 (exactly 50Hz) working. Every pixel suddenly became the same width.

Agree about the UART life line. I have a FlashAir as well, but it's really, really flaky, and needs to be very close to the router if you're not connecting directly to it from the PC. In the end I got a wifi extender and plugged it in 3 feet away, which helped.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel Spectron 2084blog

Post Reply