6809 experiments

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
RobC
Posts: 1823
Joined: Sat Sep 01, 2007 9:41 pm

Re: 6809 experiments

Postby RobC » Fri Jul 28, 2017 7:57 pm

Great stuff - looking really good!

dominicbeesley wrote:Does anyone know how many monitors were true TTL and if things like the Microvitec Cub would produce an analogue display if fed non-ttl inputs?

If you change some links inside the Cub, it'll to do analogue. Documenting the mod is on my TODO list.

dominicbeesley wrote:Oooh, I just spotted the 10 character per line mode that I'd forgotten...256 colours at a rather grainy 80x256 pixels!
I wonder, would this be possible with the VideoNuLA?

I thought about it at one point as the same screen mode is available on the Enterprise (may even have mentioned it in the thread). Given the amount of space left, the 256 colour palette would have to be derived by a fairly simple algorithm...

dominicbeesley
Posts: 466
Joined: Tue Apr 30, 2013 11:16 am

Re: 6809 experiments

Postby dominicbeesley » Mon Jul 31, 2017 9:30 am

Thanks Rob,

I've ordered some more parts this week. The RAMDAC isn't happy with > 2V and starts crushing whites and I don't want to get distracted by designing my own video amplifier circuits so I've ordered an LT6207 4 channel amplifier chip, according to my efforts in LTSpice this should work well (4V out). Also, I've designed a test board containing the RAMDAC, chip select logic, video amplifer and a Chroma generator chip. When this comes back from China, if it works, I should be able to get stuck in designing the new main board.

I've got it all running at 4MHz CPU + 4MHz screen in ModelSim but I realised I've not modelled in the delays of the 5V to 3.3V level shifters so I need to do a bit of work there. It would be a shame to order these expensive boards, build it and then it not work!

Last night I had a play with the RAMDAC palette, and added a registered palette shift register. This EORs a byte with the value being sent to the RAMDAC allowing fast selection of any of 16 palettes in a 16 colour mode again, givin 256 colours. The loads are registered on the rising edge of DISEN so there's no tearing or speckles, I've got my SYSVIA's PB6 hooked up to DISEN too and this changes to the next palette after 16 lines.

Something similar might be achievable on the beeb+VideoNULA if there were room for more palette entries but I suspect the '570 will be pretty full as it is!

D
Attachments
20170731_101532-s.jpg

dominicbeesley
Posts: 466
Joined: Tue Apr 30, 2013 11:16 am

Re: 6809 experiments

Postby dominicbeesley » Fri Aug 04, 2017 11:02 am

I've been "validating" the design by trying to port a game this week while I wait for my next board to arrive. I decided to port Tricky's Phoenix clone. This has taken me down the rabbit hole of scrolling and vertical rupture...Thanks to RTW's very helpful article I've now got my head round this and got smooth vertical scrolling working. However it has thrown up a few differences and design issues that have led to me improving a few things.

On this machine PB6 was free on the system VIA so I've hooked that up to the CRTC DISEN signal. This can be set up to decrement Timer 2 at _the end_ of an active video line (not border lines) and palette swapping or vertical rupture timing can be run from this.

However, I'm not sure DISEN is the right signal...maybe horizontal sync would be better? I may feed this through the VIDC on the final board and allow user selection of 1MHz, 2MHz, Hsync, Vsync, DISEN.

Because the palette can be switched between banks easily the smooth top/bottom borders of the scrolling area are achieved by blanking the palette rather than in RTW's original method of adding a phoney CRT cycle at the top, this is a little easier and uses fewer cycles.

It still took me a good while to get my head round it!

I've made a quick video of a scrolling picture (1 pixel each CRT frame) with a 256x216 scrolling area and a 256x16 fixed area each with different palettes.

https://youtu.be/uG8ckUhwWL0

D

User avatar
Rich Talbot-Watkins
Posts: 1121
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca

Re: 6809 experiments

Postby Rich Talbot-Watkins » Fri Aug 04, 2017 11:47 am

Hey Dominic

You still need two CRTC frames per TV frame* because this is the easiest way of ensuring that there are exactly 312 lines between VSyncs, while inserting extra scanlines (via CRTC R5) to change the offset of the top border. The advantage of this is that it allows a static screen area underneath the scrolled part (with an different R5, making the total extra scanlines up to 8) which you can use for score etc.

The screen blanking to keep the top border looking static is a different (cosmetic) issue, which requires a different interrupt.

Haven't quite followed what you were saying there, but do make sure that you're outputting 312 lines between VSyncs, because some monitors will roll and do crazy things if you don't (although a modern TFT is probably fine with it).

* You don't actually need two CRTC frames: you can do it the way Firetrack does it, which is to compensate for the extra scanlines at the end of the top border by using careful timing to add extra scanlines into a character row in the bottom border, so that they add up to a multiple of 8 by VSync. But that's far trickier timing, and won't give you a nice static area at the bottom.

Looks lovely by the way - really great project!

dominicbeesley
Posts: 466
Joined: Tue Apr 30, 2013 11:16 am

Re: 6809 experiments

Postby dominicbeesley » Fri Aug 04, 2017 1:32 pm

Sorry I didn't explain that well: I have two CRTC cycles (one without vsync) as per your (very helpful) article. But in your example to blank out the unwanted lines at the top you disable screen output (with register R8 set to disable DISEN) that's no good for me as my TMR2 stops running so instead I just blanked the palette (which on my hardware is a single write to a register to select and alternate set of 4 colours).

I could still do it the same way with Timer 1 but as I'd already setup Timer 2 to count lines I thought I might as well use that!

The pros of timer 2 are that it fires its interrupt earlier than hsync does - just as the border is starting on the right so more time to fit stuff in before the next line. Also, in other places where it is used (palette switching per line in the MOS) I don't have to compensate for *TV as it just counts active lines.

The main con is that it only counts active lines so can't do anything in between active portions.

I know all about tellys and PAL and out of spec signals - I've blown up a few with my experiments in the past. I have a collection of old and newer tellys (1950's onwards). I'm lucky in testing this stuff in that I have a CRT (Sony pro monitor) that will handle out of spec syncs without rolling or worse: try driving most CRT with out of spec line frequency and watch the line output transistor or transformer go pop!). If I press the debug button on my machine (stopping interrupts) it sometime gets stuck in the status bar in which case I get three one above the other nicely locked too. If it gets stuck in the top half I get a rolling picture as there's no Vsync.

Most older CRTs will handle being fed frames with too few lines though but not far too many. For example my old satellite receiver would output some kind of half and half NTSC/PAL signal for some channels (525 lines at 60Hz with NTSC colour but with a subcarrier of 4.443MHz) my older tellys worked fine with that with a reduced height picture and no colour. Most modern TFTs panicked and gave "no signal"!


D

dominicbeesley
Posts: 466
Joined: Tue Apr 30, 2013 11:16 am

Re: 6809 experiments

Postby dominicbeesley » Thu Aug 17, 2017 8:54 am

I've taken a break from games to attack more MOS/BASIC stuff - with lots of help and advice from JGH.

This week I have been looking at porting a filing system across - this will be a mash up of the latest MMFS but with a Vinculum VDIP as the acrtive device so using a usb flash instead of an MMC. Somewhere between MMFS and RAMFS.

Slow going, so far I've got *HELP working (which meant writing all the stuff in the ROM to do service calls, ROMS catalogues, etc)

D
Attachments
20170817_094625-s.jpg

dominicbeesley
Posts: 466
Joined: Tue Apr 30, 2013 11:16 am

Re: 6809 experiments

Postby dominicbeesley » Fri Sep 01, 2017 2:50 pm

The filing system thing has taken a _lot_ longer than I expected but has forced me to address a lot of the stuff that was missing in the MOS and to get my head into the Vinculum / FTDI / USB thing. It's nowhere near finished but *. now works!

D
Attachments
20170901_153837-s.jpg

dominicbeesley
Posts: 466
Joined: Tue Apr 30, 2013 11:16 am

Re: 6809 experiments

Postby dominicbeesley » Sun Sep 10, 2017 4:45 pm

Milestones achieved:
- basic FS working (*CAT, *LOAD, LOAD, CHAIN)
- CLOCKSP now runs to completion!

BASIC is getting close to usable now. There is a horrible bug hidden somewhere in the floating point routines, once that is fixed, I'm going to stop concentrating on BASIC for a while and put it to one side. However, if anyone's interested I'll look into putting the code up on GitHub?

D
Attachments
20170910_170852-s.jpg

User avatar
BigEd
Posts: 1500
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: 6809 experiments

Postby BigEd » Sun Sep 10, 2017 5:00 pm

Oh, yes please, do publish!

User avatar
hoglet
Posts: 6629
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: 6809 experiments

Postby hoglet » Sun Sep 10, 2017 6:15 pm

Yes, please do push a copy of this to github.

Is there any reason it shouldn't work on the Matchbox and/or PiTubeDirect? I remember there was some discussion a few weeks ago about changing some of the 6809 Tube Client ROM APIs. I don't remember what the outcome was.

Dave

User avatar
jgharston
Posts: 2764
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield

Re: 6809 experiments

Postby jgharston » Sun Sep 10, 2017 10:31 pm

hoglet wrote:Is there any reason it shouldn't work on the Matchbox and/or PiTubeDirect? I remember there was some discussion a few weeks ago about changing some of the 6809 Tube Client ROM APIs. I don't remember what the outcome was.

It should work directly on the MatchBox and Pi, and that's what I've been testing it on here. I've been busy jumping between work and replastering after the burst pipe, so haven't been able to keep people updated, but here are the updates. The change is the swapping of the endianness of the filing system calls and the tighting up of OSINIT so its return values can be used to tell what endianness is being used.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

dominicbeesley
Posts: 466
Joined: Tue Apr 30, 2013 11:16 am

Re: 6809 experiments

Postby dominicbeesley » Sun Sep 10, 2017 11:21 pm

Yes, JGH and I have been busy in the background sorting out the APIs, I've made a whole lot of changes to BASIC and the 6809 MOS to try and harmonise between 6809tube, Matchbox/PI and my "machine"+MOS (I need to think of a name for it!).

The BASIC is getting there but I keep uncovering niggles and bugs. I'm using SVN internally as my source control but I'll start putting releases up on GitHub after this week. I'll move over fully to GitHub at some point. I have a large, horrid, makefile system that builds BASIC, MOS, USBFS and test ssds that I probably need to unpick into several separate repositories, though I may leave as one big project for now.

I'm just sorting a few bugs out from when I started and I though that LDA B,X on the 6809 did the same as LDA ($xx),Y but it doesn't it treats B as 2's complement! (I'm not alone, I think JGH managed to get tripped by that too!).

D

User avatar
jgharston
Posts: 2764
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield

Re: 6809 experiments

Postby jgharston » Tue Sep 12, 2017 12:51 am

dominicbeesley wrote:I'm just sorting a few bugs out from when I started and I though that LDA B,X on the 6809 did the same as LDA ($xx),Y but it doesn't it treats B as 2's complement! (I'm not alone, I think JGH managed to get tripped by that too!).
Yes, doing 256-byte language transfer doesn't really work when you store the received bytes at 8000-807F followed by 7F80-7FFF. ;)

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

dominicbeesley
Posts: 466
Joined: Tue Apr 30, 2013 11:16 am

Re: 6809 experiments

Postby dominicbeesley » Tue Sep 12, 2017 12:10 pm

That and the fact that the carry flag is a borrow flag has lead to many interesting errors.

I'm now nearly there with captain pugwash! It works without envelopes but sounds like a cliched pile up of American police cars at the end of any 1970's road movie with envelopes...

D

dominicbeesley
Posts: 466
Joined: Tue Apr 30, 2013 11:16 am

Re: 6809 experiments

Postby dominicbeesley » Tue Sep 12, 2017 6:50 pm

Captain Pugwash now works! So I'm going to give BASIC development a bit of a rest and concentrate on the next version of the motherboard now. This will take some thought as I want to give it plenty of thought and try and get it more or less right first time as the PCBs will not be cheap!

I've also put up the sourcecode on github https://github.com/dominicbeesley/beeb6809

It needs a *nixey type environment to compile (I use Cygwin but it should work on Linux), also needed are asm6809 which can be downloaded from the net and dfs (for building disc images not needed for BASIC on its own). If you just want BASIC then you should be able to just cd rom-dev/BBCBASIC and run make.

I've attached a binary, this should work on matchbox/PItube just
*LOAD 6809BAS 8000
*GO 8000

You will need to have JGH's latest client rom (1.05) soft-loaded.

There's still plenty to do, lots of things will just cause an abort message and register dump or worse but there's enough there to write proper programs. At some point I'll document what is missing / untested.

D

PS: The missus is now sick of Captain Pugwash, the 2yr old daughter loves it. So much she remembered RUN and ESCape when she was shown the first time she was shown, she's never shown the slightest interest before!

User avatar
daveejhitchins
Posts: 3692
Joined: Wed Jun 13, 2012 5:23 pm
Location: Newton Aycliffe, County Durham

Re: 6809 experiments

Postby daveejhitchins » Wed Sep 13, 2017 9:33 am

dominicbeesley wrote:PS: The missus is now sick of Captain Pugwash, the 2yr old daughter loves it. So much she remembered RUN and ESCape when she was shown the first time she was shown, she's never shown the slightest interest before!
=D> =D> :lol: :lol: :lol: =D> =D>

Dave H :D
Parts: UM6502CE, GAL22V10D, GAL16V8D, AS6C62256A, TC514400AZ, WD1772, R6522, TMS27C512, AT28C256
Products: ARA II, ABR, ATI, AP6, MGC, AP5 . . .
For a price list, contact me at: Retro Hardware AT dave ej hitchins DOT plus DOT com

dominicbeesley
Posts: 466
Joined: Tue Apr 30, 2013 11:16 am

Re: 6809 experiments

Postby dominicbeesley » Wed Sep 13, 2017 1:23 pm

I have a question about disc controller chips. Would the MB8877a work with BBC micro discs (I have a number of these form Lez Anderson, thanks Lez!). If not I'll probably crib something from the Master and use a WD1770?

I think on my next board design I'm going to leave a couple of headers to allow any disc controller to be plugged in. I don't know (or care) enough about them at the moment to build one onto the next board. I do want to start thinking about it though...

D

User avatar
Pernod
Posts: 1001
Joined: Fri Jun 08, 2012 10:01 pm
Location: Croydon, UK

Re: 6809 experiments

Postby Pernod » Wed Sep 13, 2017 2:04 pm

dominicbeesley wrote:I have a question about disc controller chips. Would the MB8877a work with BBC micro discs (I have a number of these form Lez Anderson, thanks Lez!). If not I'll probably crib something from the Master and use a WD1770?

Yes, the Cumana QFS board uses them, see http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Cumana_QFS.html. I have this board emulated in MAME and it works well.
- Nigel

BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.

dominicbeesley
Posts: 466
Joined: Tue Apr 30, 2013 11:16 am

Re: 6809 experiments

Postby dominicbeesley » Wed Sep 13, 2017 3:35 pm

Thanks Nigel, I'd not spotted that one. I think I'll go with the 8877s then!

I'll have to have a pour over the datasheets with a bottle of red one evening and work out if it will do ADFS to 720/800k

D

dominicbeesley
Posts: 466
Joined: Tue Apr 30, 2013 11:16 am

Re: 6809 experiments

Postby dominicbeesley » Sun Sep 17, 2017 3:20 pm

I've got a bit of the way in speccing out the new version, including throwing together more VHDL test cases (I want to work out feasibility of a blitter / DMA chip before I start laying out boards).

As an aide memoire I've been sketching it out on paper (red = 5V, blue = 3.3V), it seems to concentrate the mind when using a pencil...I might have to start using an electronic tool though, I've discovered my daughter's crayola pencils don't rub out...now where did I put the Virtual Acorn discs...
Attachments
20170916_183329-s.jpg

dominicbeesley
Posts: 466
Joined: Tue Apr 30, 2013 11:16 am

Re: 6809 experiments

Postby dominicbeesley » Fri Oct 06, 2017 3:34 pm

Hello,

between trying to get my broadband moved to the new house and not packing my stuff I've been messing around with the 6309's built in 16 bit multiply instruction and got a full-screen Mandelbrot set running in under 2 minutes! (Processor at 2MHz, size is 160x256 pixels, max iterations 64, fixed point 4+11 arithmetic).

Now, I have a question for anyone whose brain is working better than mine: is it possible to convert the result of a signed 16x16 multiply to be as if it were an unsigned mul? The 6309's built in 16x16 mul is signed but I'm wanting to used it as part of a 32x32 multiply but I can't work out how to do it other than making it into a 15x15 bit unsigned multiply and shifting and adding...


crj
Posts: 328
Joined: Thu May 02, 2013 4:58 pm

Re: 6809 experiments

Postby crj » Fri Oct 06, 2017 5:02 pm

If you have a multiplier that takes signed n-bit values X and Y, returning a signed 2n-bit value ZH,ZL and you wanted an unsigned 2n-bit value...

If X is negative, add Y to ZH; if Y is negative, add X to ZH.

(If both are negative, add both. If there's carry out of ZH, ignore it.)

dominicbeesley
Posts: 466
Joined: Tue Apr 30, 2013 11:16 am

Re: 6809 experiments

Postby dominicbeesley » Fri Oct 06, 2017 5:33 pm

Thankyou, I thought I'd tried that (on pencil and paper) but it didn't seem to work, I suspect it was the hangover! You've saved me a lot of time there and should make for a distinct speed improvement in BBCBASIC. I just looked at my workings and I was adding X if X was negative...doh!

D

User avatar
fordp
Posts: 923
Joined: Sun Feb 12, 2012 9:08 pm
Location: Kent, England

Re: 6809 experiments

Postby fordp » Wed Oct 18, 2017 12:17 pm

Silly question time.

If an ICE T65/Z80/6809 were configured as electrically a 6502 but with 6809 instruction set would your code run in a standard BBC B board?
FordP (Simon Ellwood)
Time is an illusion. Lunchtime, doubly so!

dominicbeesley
Posts: 466
Joined: Tue Apr 30, 2013 11:16 am

Re: 6809 experiments

Postby dominicbeesley » Wed Oct 18, 2017 12:28 pm

Not quite, I've used different hardware addresses for many things and some things such as the Video ULA and memory controller which does the swapping in / out of ROMs. Also, whilst BBC BASIC is 6809 friendly the MOS ROM I've written expects a 6309 rather than a 6809. However, it should be easy enough to spot the offending code where I've used the extra W,E,F registers or extra instructions.

So, not a simple swap but not impossible.

I'd not followed the ICE T65 thing at all, it's the first I'd seen of it. I may get one and have a go, how do I get hold of one, xeropage.com is not working?

D

User avatar
hoglet
Posts: 6629
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: 6809 experiments

Postby hoglet » Wed Oct 18, 2017 12:44 pm

dominicbeesley wrote:I'd not followed the ICE T65 thing at all, it's the first I'd seen of it. I may get one and have a go, how do I get hold of one, xeropage.com is not working?

The original hardware (the GODIL fpga board) is no longer available.

The best current replacement is:
http://www.ebay.co.uk/itm/Xilinx-FPGA-S ... 1640406811

plus a separate level shifter from Jason:
http://www.xeropage.co.uk/shop/index.ph ... er=product

Designs are all open source here:
https://github.com/hoglet67/AtomBusMon/ ... /lx9_jason

Documentation is here:
https://github.com/hoglet67/AtomBusMon/wiki

The 6809 flavour has been tested on a Grant Searle system, and on a Dragon 32:
https://github.com/hoglet67/AtomBusMon/wiki/ICE-6809

Dave

dominicbeesley
Posts: 466
Joined: Tue Apr 30, 2013 11:16 am

Re: 6809 experiments

Postby dominicbeesley » Wed Oct 18, 2017 1:33 pm

Thanks Dave,

I've ordered a level shifter, I already have a DE0 nano,will that work?

D

dominicbeesley
Posts: 466
Joined: Tue Apr 30, 2013 11:16 am

Re: 6809 experiments

Postby dominicbeesley » Wed Oct 18, 2017 1:42 pm

Or could it be made to work with this one at a push?

https://shop.trenz-electronic.de/en/TE0 ... odule?c=97

D

User avatar
hoglet
Posts: 6629
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: 6809 experiments

Postby hoglet » Wed Oct 18, 2017 1:50 pm

dominicbeesley wrote:I've ordered a level shifter, I already have a DE0 nano,will that work?

Not without a fair bit of new development work.

dominicbeesley
Posts: 466
Joined: Tue Apr 30, 2013 11:16 am

Re: 6809 experiments

Postby dominicbeesley » Wed Oct 18, 2017 3:41 pm

Thanks Dave,

I've ordered that spartan board, I couldn't find much documentation about how the level shifter board works or how to map the pins onto that Spartan Board....no doubt I'll be back with questions when the parts arrive....

Is there something Xilinx specific or would it just be the usual faff of setting up the project in Quartus instead of Xise?

D


Return to “hardware”

Who is online

Users browsing this forum: cmorley, daveejhitchins and 11 guests