Atom 6809

discussion of games, software, hardware & emulators relating to the Acorn Atom and Acorn System machines.
User avatar
roland
Posts: 3379
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Atom 6809

Post by roland » Sat Aug 02, 2014 1:23 pm

I started a new topic because the 6809 posts in Flappy bird are not on topic there.

In the past I had a 6809 working as a second processor for my atom. The circuit board is shown in this picture:
image.jpg
The crystal is missing here. I guess I needed it for another project :) On the atom disc archives I found some software I wrote for it, such as a simple monitor program for editing the memory, starting a routine, load and save a file. It used the atom for its I/O. I must have been inspired by the beeb's tube as I use this name literally in the source code.

There was even a serious application for it. Bitd Kees connected a mouse to his atom. I did also but I modified a Genius mouse. To read the mouse some communication had to been done which was a bit time consuming. But i wrote a routine that made the 6809 handle the mouse so the 6502 just had toask the 6809 about the mouse x, y and button status.

The software is still available on acornatom.nl in the disc archive on disk DD-47.

The earlier version of a 6809 cpu board was designed by Bas Kasteel. He designed a conversion board but that would replace the 6502 so there was only one cpu. As it had no own rom you had to replace ic20 with a rom that could handle the bootstrap of the 6809. This is the pcb he used:
image.jpg
I never build this one and the components are only informative. By using some suitable header connector you could place this in the 6502 socket and off you go. The mod is easy to undo. I intended to use this circuit on my Atom-In-pc but I never got that far.

At the moment I have no serious plan for the 6809, but who knows what happens when I finish my new atom main board....
256K + 6502 Inside
MAN WOMAN :shock:

User avatar
roland
Posts: 3379
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: Atom 6809

Post by roland » Sat Aug 02, 2014 10:35 pm

There is an open source port of OS-9 (NitrOS-9) that runs on the Tandy Colour Computer & the Dragon 64, shouldn't be too hard to port that.

Cheers

Phill.
I have been reading about NitrOS-9 and it could be a nice goal to make that run on an Atom with one of those 6809 implementations. I will keep a tube-alike interface in mind with my new Atom main-board design. This might keep us off the streets for a few months :D
256K + 6502 Inside
MAN WOMAN :shock:

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

Re: Atom 6809

Post by hoglet » Sun Aug 03, 2014 7:25 am

Maybe we should look at doing something with this:
http://members.optusnet.com.au/jekent/system09/

Now, I wonder if there is room in the GODIL? :lol:

The answer is likely to be not quite enough....

Dave

User avatar
roland
Posts: 3379
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: Atom 6809

Post by roland » Sun Aug 03, 2014 8:59 am

All of that in the same Godil as the atom video or do we have to buy another Godil?
256K + 6502 Inside
MAN WOMAN :shock:

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

Re: Atom 6809

Post by hoglet » Sun Aug 03, 2014 9:35 am

roland wrote:All of that in the same Godil as the atom video or do we have to buy another Godil?
There is a chance it would all fit into one GODIL, if you used the larger GODIL (with the XC3S500E FPGA). Unfortunately, that's not the one I bought. :(

You would also need something like the Acorn TubeULA to allow the two processors to efficiently communicate. But that's another story.... :D

Dave

User avatar
roland
Posts: 3379
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: Atom 6809

Post by roland » Sun Aug 03, 2014 10:25 am

It's quite interesting how Acorn created the Tube. Only 8 bytes in memory map for communication with the second processor. Although I must say the communication I used in my Atom-in-PC (6522 in Atom, 8255 in PC) was also fine. The data-transfers were only about max 16 kB so it was fast enough that way.

However ... it looks like I have still 1 output pin available in the memory decoder CPLD of my new Atom main board design. I think I will call it Tube :)
256K + 6502 Inside
MAN WOMAN :shock:

Prime
Posts: 2784
Joined: Sun May 31, 2009 11:52 pm
Contact:

Re: Atom 6809

Post by Prime » Sun Aug 03, 2014 11:23 am

There is a 'trick' that I have seen documented that allows two 6809s to run on the same bus at the same time (without wait states). It may also work with a 6809 & 6502, since they have essentially the same bus.

Basically the 6809 & 6502 only access the bus with E / PHI2 is high, so you feed the 6809 with E and the 6502 with !E and they should access the bus on the opposite sides of the clock.

Dunno how this would work with VHDL implementations tho.

Cheers.

Phill.

User avatar
roland
Posts: 3379
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: Atom 6809

Post by roland » Sun Oct 12, 2014 5:33 pm

The idea of a 6809 second cpu on my Atom kept my thoughts busy when I was not thinking about my new Atom design, beer or women :mrgreen: So I did search the web for Nitros/9 to run on home brew systems. There is not very much usable information but when I downloaded the sources I came across this in one of the files:

Code: Select all

*	   2006/07/06	P.Harvey-Smith.
* Conditionally excluded port messages on Dragon Alpha, due to insufficient
* space !
*
Hey ... that a familiar name :)

Phill, do you still have knowledge how Nitros/9 is build and how it can be ported to an Atom 6809 system?

The setup I have in mind can be build with only six ic's:
- 6809 or 6809E
- two CPLD's
- 4 kb EPROM
- 512 KB RAM
- a real-time clock (I still have a wonderfull DP8570A TCP)

The memory map will be:
0000 - 7FFFF: 15 banks of 32kB ram
8000 - EFFF: 28 kB ram fixed, non switchable
F000 - F0FF: I/O space (bank select register, RTC and communication with Atom)
F100 - FFFF: 3.75 kB ROM (hardware vectors, monitor, boot routine, basic I/O)

The Atom will be used as I/O system for keyboard, video, storage etc.

Porting Nitros/9 will involve these major steps:
- writing the basic I/O commands to communicate with the Atom
- loading the kernel and other os files from the Atom
- whatever we may encounter....

It will take a while before I actually start with this project. If someone is interested I will post my first sketch. However, it is just a sketch and I don't know if it can be made with the two CPLD's I have in mind.

I think this will be my 2015 project 8)
256K + 6502 Inside
MAN WOMAN :shock:

Prime
Posts: 2784
Joined: Sun May 31, 2009 11:52 pm
Contact:

Re: Atom 6809

Post by Prime » Thu Oct 16, 2014 9:28 pm

Nitros-9 :) Been a while since I worked on it, and I only really worked on the Level 1 code as that's all the Dragon 64 / Alpha was capable of running only having 64K.

The Dragon Beta was another beast entirely which had a max memory of 1M :) and ran OS-9 Level 2.

But the way level 2 works is that you have the 512K (or whatever) divided up into pages, I believe that the CoCo3 used 8 x 8K pages, the Beta was 16 x 4K. Each 'task' has a set of pages assigned to it so that when that task is active it sees it's own 64K of memory, IIRC the system was task 0.

On the CoCo the GIME custom chip did the mapping, on the Beta it was done with a 6821 (to select the task), and a dual port RAM to do the actual address re-writing. This may be the easiest way to go,maybe using the CPLD instead of the 6821.

There is no reason that the Atom could not be used for I/O sorta like the tube idea on the BBC. The propper way to do it would be to write Nitros-9 device drivers for the disks, screen and I/O.

If you are going to have a go at this it is worth reading up on how the CoCo & Dragon are constructed a good description of the Dragon can be found in 'Inside the Dragon' which can be found on the Dragon archive site here :

http://archive.worldofdragon.org/archiv ... dir=Books/

Cheers.

Phill.

User avatar
roland
Posts: 3379
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: Atom 6809

Post by roland » Fri Oct 17, 2014 4:23 pm

Thank for your answer. I have had a quick look at the books. "The Dragon 32 Dragon Companion" has an interesting start about 8 colour modes of the 6847. I wonder if they are also available on an Atom. More stuff to investigate.....

When I grow up (or old) I will start with level 1 and try to get level 2 running after that.

But first getting my new Atom working. Waiting takes soooooooo loooooooong
256K + 6502 Inside
MAN WOMAN :shock:

User avatar
roland
Posts: 3379
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: Atom 6809

Post by roland » Tue Nov 04, 2014 8:26 pm

While still waiting for my 6502 (Atom) main board, I already designed a parasite board with a 68B09. By using some jumpers and modifying the contents of the CPLD's I have some flexibility for choosing either a normal 68B09 or a 68B09E. The same goes for the EPROM size: 8, 16 or 32K. I will probably use a small eprom and load the system into the 512 kB ram. The parasite can also generate an IRQ or NMI to the Atom.

This is the first sketch of the diagram:
Atom6809.jpg
With great interest I read Hoglet's threat with the matchbox size tube but if I see what kind of problems he encounters I prefer some simple logic which I can still understand and debug with limited tools.
256K + 6502 Inside
MAN WOMAN :shock:

User avatar
roland
Posts: 3379
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: Atom 6809

Post by roland » Sun Nov 09, 2014 4:18 pm

While others are doing real magic with a second <whatever> cpu in a single FPGA chip, I completed the first design of my Atom 6809 board. I made it as flexible as possible with some jumpers.

I used a DP8570 RTC because it's a nice clock device lying somewhere on my attic. It is not really needed for the 6809 to run but it will serve as a timer device when I'm going to try Nitros9. However, if the RTC is not available the Atom VIA can create the interrupts by using PB7 as a timer output. Because it's the only interrupt source for the 6809 the software knows where it's coming from.
Schermafbeelding 2014-11-09 om 17.10.13.png
256K + 6502 Inside
MAN WOMAN :shock:

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

Re: Atom 6809

Post by jgharston » Fri Jan 02, 2015 6:21 pm

Now, I've got a Boundary Commission report to write, my tax return to complete, so what shall I do?

Ooo, shiney!!

:)

Not completed, just character I/O and OPEN/GET/PUT/CLOSE, and I don't have anything to test it on, but it starts up ok on Atomulator. Somewhere I downloaded roland's 6809 card test code, so that will tell me where the hardware is, and I can change the I/O addressing to match.

Code: Select all

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

User avatar
oss003
Posts: 3097
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: Atom 6809

Post by oss003 » Fri Jan 02, 2015 9:42 pm

Hi jgh,

I have attached 3 programs for the 6809 board that Roland wrote back in the 90's for Atom-6809 communication. Looked like all communication was done through 1 byte #BD40. 4 Bits are used to send/receive a nibble and 4 bits are control bits IIRC.

(The link to #1FFA is to initialize an external 80-column board.)

Can you explain how you tested your tube software in Atomulator? If I look at the diskimage, $.TUBE is loaded at #8000 (This is the screen in the Atom map???) and the S.TUBE file doesn't have a valid load address. Is this a maybe a BBC disk or did you change the Atomulator code?

You and hoglet are doing some fabulous stuff with co-processors =D> =D> respect......... but I never used a second processor so this is all new to me. Can you give me a 'simple' overview of how a second processor system operates and how do you see it to be running on an Atom? Do you need hoglets AtomTUBE? Thanks.

Greetings
Kees
Attachments
6809 SOFTWARE.txt
(4.43 KiB) Downloaded 68 times

User avatar
roland
Posts: 3379
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: Atom 6809

Post by roland » Fri Jan 02, 2015 11:21 pm

What a code ... Forgive me, I was young and unexperienced when I wrote that :oops:

I don't think that this is very useful because there was also some code needed at the 6809 rom. That is not provided here and I don't know if I have it somewhere. Wait, I have a recent photograph of the eprom so I should be able to read the eprom :lol:

The communication was indeed two subsequent nibbles for transferring a byte. It made the board layout easy, I guess :?
256K + 6502 Inside
MAN WOMAN :shock:

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

Re: Atom 6809

Post by hoglet » Sat Jan 03, 2015 9:08 am

jgharston wrote:Not completed, just character I/O and OPEN/GET/PUT/CLOSE, and I don't have anything to test it on, but it starts up ok on Atomulator. Somewhere I downloaded roland's 6809 card test code, so that will tell me where the hardware is, and I can change the I/O addressing to match.
Nice!

I spotted a few remaining absolute addresses:
e.g.

Code: Select all

  740 \ BRK handler
  750 \ -----------
  760 .TubeBRK
  770 LDA #&FF:JSR &066C                 :\ Send &FF to R4 to interupt CoPro
but as you say, this is unfinished.

We really will have to think about an actual tube interface for the Atom now!

I can think of two ways to connect to the Atom:

- PL8 - all the signals we need are present, but this is used by AtoMMC. Maybe A3=0 could select AtoMMC and A3=1 could select Tube.

- PL6/7 - the only missing signal is HCS (the chip select to select the tube), so some further decoding would be needed.

Has anyone considered making a Atom expander that plugged into PL6/7, and that gave you multiple versions of PL8, decoded to different addresses. They could be used as follows:
- B400 - AtoMMC
- B500 - Big Benny
- B600 - spare
- B700 - spare
- BC00 - spare
- BD00 - AtomSID
- BE00 - AtomTube
- BF00 - spare
The decoding would just be with a simple PAL (A15..A8) -> Chip Selects

Dave

User avatar
roland
Posts: 3379
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: Atom 6809

Post by roland » Sat Jan 03, 2015 1:50 pm

Hoglet wrote:Has anyone considered making a Atom expander that plugged into PL6/7, and that gave you multiple versions of PL8, decoded to different addresses. They could be used as follows:
- B400 - AtoMMC
- B500 - Big Benny
- B600 - spare
- B700 - spare
- BC00 - spare
- BD00 - AtomSID
- BE00 - AtomTube
- BF00 - spare
The decoding would just be with a simple PAL (A15..A8) -> Chip Selects
Nice idea, however some of those addresses are already used by old Atom hardware, such as #BC48 (modified Acorn FDC), #BExx (80 column video adapter), #BFFF (bank switch). But only a few people still use these expansions.

If you use a GAL20V8 with 12 inputs you can create eight address ranges in the block #B400 - #B7FF. It will also be compatible with the new Atom board.

BTW, I use in my 6809 board one CPLD as tube. It has two registers for each cpu: a data register and a status register. It's more a simplified version of two via's connected to each other. What do you have in mind for communication between host and parasite in the Atom?

Actually, it doesn't really matter if we create a hardware abstraction layer in the software. Something like OSBYTE and OSWORD calls. I will certainly have a look at the routines that JGH has in his 6809 setup. With the right support at the Atom side the Exbas09 should be up and running without much trouble.
256K + 6502 Inside
MAN WOMAN :shock:

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

Re: Atom 6809

Post by hoglet » Sat Jan 03, 2015 2:03 pm

roland wrote:BTW, I use in my 6809 board one CPLD as tube. It has two registers for each cpu: a data register and a status register. It's more a simplified version of two via's connected to each other. What do you have in mind for communication between host and parasite in the Atom?
All the parasites we have so for (for the LX9 Co Pro board) already include the Acorn Tube design, so I was thinking of just using that. It's also what JHG is assuming in his Atom Tube host code, which I think is a port of the BBC Tube host code.

Dave

User avatar
roland
Posts: 3379
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: Atom 6809

Post by roland » Sat Jan 24, 2015 7:19 pm

Today, after building a few snow men with my neighbour's children, I started building my Atom 6809 board. Most components, or at least their sockets, are mounted on the board now.

The next step will be to program the CPLD's and an eprom with a simple test program and then I hope to see a "Hello world from 6809" on my Atom's screen.
20150124_201135_resized.jpg
256K + 6502 Inside
MAN WOMAN :shock:

User avatar
roland
Posts: 3379
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: Atom 6809

Post by roland » Wed Jan 28, 2015 11:16 pm

I have made a mistake in my VHDL code for the Atom6809 address decoder, but I don't see it. This is my code:

Code: Select all

----------------------------------------------------------------------------------
-- Company: 		acornatom.nl
-- Engineer: 		roland leurs
-- 
-- Create Date:    22:22:03 01/28/2015 
-- Design Name: 	
-- Module Name:    p6809-memory-decoder - Behavioral 
-- Project Name: 
-- Target Devices: 
-- Tool versions: 
-- Description: 
--
-- Dependencies: 
--
-- Revision: 
-- Revision 0.01 - File Created
-- Additional Comments: 
-- 		Use this design only with 6809 installed!
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity p6809MemoryDecoder is
Port ( 
	DD:	inout	STD_LOGIC_VECTOR (7 downto 0);
	AA:	in	STD_LOGIC_VECTOR (15 downto 6);
	EA: out STD_LOGIC_VECTOR(18 downto 15);
	CS_ROM, CS_RAM, CS_TUBE, CS_RTC: out STD_LOGIC;
	PRW, RESET, PCLK: in STD_LOGIC;
	PNWDS, PNRDS: out STD_LOGIC;
	E, Q: in STD_LOGIC
);
end p6809MemoryDecoder;

architecture Behavioral of p6809MemoryDecoder is

signal regFE80 :	STD_LOGIC_VECTOR(7 downto 0);
signal nRD, nWR:	STD_LOGIC;
signal BS:	STD_LOGIC_VECTOR(3 downto 0);
signal RAMROM:		STD_LOGIC;

begin
	process(E)
	begin
		-- write FE80 (bank switch register)
		if falling_edge(E) then
			if Reset = '0' then
				regFE80 <= x"00";
			else
				if AA(15 downto 6) = "1111111010" and PRW = '0' then
					regFE80 <= DD;
				end if;
			end if;
		end if;

	end process;

	process (E, PRW)
	begin
		-- create nRDS signal
		if E = '1' and PRW = '1' then
			nRD <= '0';
		else
			nRD <= '1';
		end if;
		
		-- create nWDS signal
		if E = '1' and PRW = '0' then
			nWR <= '0';
		else
			nWR <= '1';
		end if;
		
	end process;

	process (AA, RAMROM, BS(3 downto 0))
	begin
		if RAMROM = '0' and AA(15 downto 13) = "111" and not (AA(15 downto 8) = "11111110") then
			CS_ROM <= '0';
		else 
			CS_ROM <= '1';
		end if;
		
		if (RAMROM = '1' and AA(15 downto 13) = "111" and not (AA(15 downto 8) = "11111110")) or AA(15) = '0' or AA(15 downto 14) = "10" or AA(15 downto 13) = "110" then
			CS_RAM <= '0';
		else 
			CS_RAM <= '1';
		end if;

		if AA(15 downto 6) = "1111111100" then
			CS_RTC <= '0';
		else 
			CS_RTC <= '1';
		end if;

		if AA(15 downto 6) = "1111111101" then
			CS_TUBE <= '0';
		else 
			CS_TUBE <= '1';
		end if;

		if AA(15) = '0' then
			EA(18 downto 15) <= BS(3 downto 0);
		else 
			EA(18 downto 15) <= "1111";
		end if;
		
	end process;
	
	
		-- Signals to output
	PNRDS <= nRD;
	PNWDS <= nWR;
	BS(3 downto 0) <= regFE80(3 downto 0);
	RAMROM <= regFE80(7);

	-- read registers
	DD <= regFE80 when (AA(15 downto 6) = "1111111010" and PRW = '1') else
		(others => 'Z');
end Behavioral;
It's very similar to my Atom address decoder. The lower four bits of the register (regFE80) are used for bankswitching. Bit 7 of the register is used to select ROM or RAM at E000-FFFF (except for FE00 - FEFF where the I/O lives).

However, when I look at the final optimized logic I see:

Code: Select all

EA(15) <= NOT ((NOT AA(15) AND NOT DD(0)));
EA(16) <= NOT ((NOT AA(15) AND NOT DD(1)));
EA(17) <= NOT ((NOT AA(15) AND NOT DD(2)));
EA(18) <= NOT ((NOT AA(15) AND NOT DD(3)));
When I look at the complete fitter report, it seems like the register is completely ignored.

Where did I go wrong? I dont see it #-o
Attachments
p6809MemoryDecoder.txt
(20.51 KiB) Downloaded 55 times
256K + 6502 Inside
MAN WOMAN :shock:

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

Re: Atom 6809

Post by hoglet » Thu Jan 29, 2015 7:47 am

Roland,

VHDL is not meant to be case sensitive, but some tools are.

Can you make RESET and Reset the same.

It's probably not this, but worth checking.

Otherwise, review the WARNINGs in the log very carefully. There is usually some clues there.

Dave

User avatar
roland
Posts: 3379
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: Atom 6809

Post by roland » Thu Jan 29, 2015 8:22 am

The only warnings I got was Q and PCLK not used. That's right because I don't need them if no 6809E is used.

However, when I change the source and make Reset -> RESET and introduce a dummy process with only PCLK <= not Q then this is the only warning:

Code: Select all

WARNING:Cpld - Unable to retrieve the path to the iSE Project Repository. Will
   use the default filename of 'p6809MemoryDecoder.ise'.
which is a known issue in ISE 14.7

But the problem still exists. I will have another look this evening....
256K + 6502 Inside
MAN WOMAN :shock:

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

Re: Atom 6809

Post by hoglet » Thu Jan 29, 2015 8:25 am

I've been looking a bit longer, and also can't spot anything incorrect in the vhdl.

Does the design definitely not work in practice?

Dave

User avatar
roland
Posts: 3379
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: Atom 6809

Post by roland » Thu Jan 29, 2015 10:24 am

I didn't test it yet in practise because I don't believe that it works. The (EA, extended address lines) outputs are directly controlled by the DD (data) inputs. IMHO that cannot work.

I think I'll leave the bank switching out, for now so I can test that the 6809 can communicate with the Atom. If that works, I have a solid basis to start expanding the memory capabilities.

If I try it right now I don't know what's wrong if there is no communication.
256K + 6502 Inside
MAN WOMAN :shock:

User avatar
roland
Posts: 3379
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: Atom 6809

Post by roland » Thu Jan 29, 2015 9:42 pm

On Sat Jan 03, 2015 12:21 am, I wrote: I don't think that this is very useful because there was also some code needed at the 6809 rom. That is not provided here and I don't know if I have it somewhere. Wait, I have a recent photograph of the eprom so I should be able to read the eprom :lol:
Today I had a go at reading the Eprom because it gives me some starting point that was known to work. I only have to rewrite the routines to communicate with the Atom.

It is a very simple rom. It only initializes the stack pointers and the VIA for communications (A-port). Then it prints a message and asks the Atom for an executable program. The Atom sends this program to the 6809 and at the end the 6809 starts this program.

I have already programmed the CPLD's so I now have to adapt this little boot program and then see what happens :|
Attachments
6809bios.txt
(3.35 KiB) Downloaded 55 times
256K + 6502 Inside
MAN WOMAN :shock:

User avatar
roland
Posts: 3379
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: Atom 6809

Post by roland » Thu Jan 29, 2015 9:53 pm

For everyone who is interested, this is the VHDL for the CPLD that makes the communication between my Atom and its 6809 copro:

Code: Select all

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity host2parasite is
    Port ( pd : inout  STD_LOGIC_VECTOR (7 downto 0);
           hd : inout  STD_LOGIC_VECTOR (7 downto 0);
           pclk : in  STD_LOGIC;
           prw : in  STD_LOGIC;
           pcs : in  STD_LOGIC;
           prs : in  STD_LOGIC;
           hclk : in  STD_LOGIC;
           hrw : in  STD_LOGIC;
           ha : in  STD_LOGIC_VECTOR (11 downto 4);
           hcs : in  STD_LOGIC;
           hrs : in  STD_LOGIC;
           prst : out  STD_LOGIC);
end host2parasite;

architecture Behavioral of host2parasite is

signal	pcsint, hcsint : STD_LOGIC;
signal	hibf, hobf, pibf, pobf : STD_LOGIC;
signal 	hpregister, phregister : STD_LOGIC_VECTOR(7 downto 0);
signal 	statusreg: STD_LOGIC_VECTOR(7 downto 0);
begin
	process (hcs, ha(11 downto 4))
	begin
		if hcs = '0' and ha(11 downto 4) = "11000000" then
			hcsint <= '1';
		else
			hcsint <= '0';
		end if;
	end process;
	
	process (pcs)
	begin
		if pcs = '0' then
			pcsint <= '1';
		else
			pcsint <= '0';
		end if;
	end process;
	
	process (hclk, hrw, hcsint, hrw, pclk, prw, pcsint, prw)
	begin
		if falling_edge(hclk) then
			-- write dataregister
			if hcsint = '1' and hrs = '0' and hrw = '0' then
				hpregister <= hd;
				hobf <= '1';
			end if;

			-- read dataregister
			if hcsint = '1' and hrs = '0' and hrw = '1' then
				hibf <= '0';
			end if;

			-- write statusregister 
			if hcsint = '1' and hrs = '1' and hrw = '0' then
				statusreg(7 downto 6) <= hd(7 downto 6);
			end if;
			
			-- set hibf
			if pobf = '1' then 
				hibf <= '1';
			end if; 

			-- reset hobf 
			if pibf = '1' then
				hobf <= '0';
			end if;
				
			-- reset signal
			if statusreg(7) = '1' and statusreg(6) = '1' then
				prst <= '0';
				hibf <= '0';
				hobf <= '0';
			else 
				prst <= '1';
			end if;
			
		end if; 
		
		if falling_edge(pclk) then
			-- write dataregister
			if pcsint = '1' and prs = '0' and prw = '0' then
				phregister <= pd;
				pobf <= '1';
			end if;

			-- read dataregister
			if pcsint = '1' and prs = '0' and prw = '1' then
--				phregister <= pd;   is verkeerd, denk ik....
				pibf <= '0';
			end if;

			-- write statusregister 
			if pcsint = '1' and prs = '1' and prw = '0' then
				statusreg(5 downto 4) <= pd(5 downto 4);
			end if;

			-- set hibf
			if hobf = '1' then 
				pibf <= '1';
			end if; 

			-- reset pobf 
			if hibf = '1' then
				pobf <= '0';
			end if;
			
			-- reset status
			if statusreg(7) = '1' and statusreg(6) = '1' then
				pibf <= '0';
				pobf <= '0';
			end if;
		end if;
	end process;

	-- read registers
	hd <= phregister when (hcsint = '1' and hrw = '1' and hrs = '0') else
	statusreg when (hcsint = '1' and hrw = '1' and hrs = '1') else
	(others => 'Z');

	pd <= hpregister when (pcsint = '1' and prw = '1' and prs = '0') else
	statusreg when (pcsint = '1' and prw = '1' and prs = '1') else
	(others => 'Z');
	
	-- reset signal
	statusreg(0) <= hobf;
	statusreg(1) <= pibf;
	statusreg(2) <= pobf;
	statusreg(3) <= hibf;

end Behavioral;
It is based on the code I used for the experimental Atomic tube
256K + 6502 Inside
MAN WOMAN :shock:

User avatar
roland
Posts: 3379
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: Atom 6809

Post by roland » Sun Feb 01, 2015 2:49 pm

Today I fixed some minor addressing bugs in my 6809 address decoder cpld and reprogrammed it with my new programming device. Works like a charm. It just needs a Vref signal connected and that is not on my board, neither on the Atom's new main board. If I connect it somewhere else to a Vref (any voltages between 1.5 and 5V seems ok for that) than it works.

The 6809 seems to be running as there is activity on the busses, but it doesn't communicate with the Atom. I'll have to go the hard way with my logic analyzer.

To be continued.....
256K + 6502 Inside
MAN WOMAN :shock:

User avatar
roland
Posts: 3379
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: Atom 6809

Post by roland » Tue Feb 03, 2015 7:42 am

So .... I took the hard way. Armed with my logic analyzer I did some tests and it looked like the databus was a mess. Also the address lines didn't show a normal behaviour.

I suspected the speed of the 2764 eprom, 200ns in a 2 MHz should be doable IMHO. But some eproms "worked" (showed normal address line behaviour but no expected data to see) and others didn't.

I found a 150ns eprom (27256) and that also showed a decent address bus. Then I found out that I connected the databus in the opposite order to my analyzer :oops:
20150201_204101_resized.jpg
After correcting this wiring I could start debugging. I found one or two bugs in my 6809 code and after fixing them:
20150203_080545_resized.jpg
Now the communication works from 6809 to 6502. The next step is to test the other way. Can the Atom send a file to the 6809 and will that one execute it .... :?:
256K + 6502 Inside
MAN WOMAN :shock:

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

Re: Atom 6809

Post by hoglet » Tue Feb 03, 2015 7:59 am

This is awesome Roland =D> =D> =D> =D>

Can you say a bit more about the "Tube protocol" you are implementing?

Dave

User avatar
richardtoohey
Posts: 3717
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: Atom 6809

Post by richardtoohey » Tue Feb 03, 2015 8:11 am

^^^ What Dave said :D

I won't be following in your footsteps but great reading about your progress and looking at the birds nest pictures. :D =D>

Post Reply