Designing a new Atom main board

emulators, hardware and classic software for atom + system machines
User avatar
roland
Posts: 3761
Joined: Thu Aug 29, 2013 9:29 pm
Location: Born (NL)
Contact:

Re: Designing a new Atom main board

Post by roland » Sun Mar 15, 2015 6:44 pm

How should the BBC keyboard be connected to the CPLD?

I think it is also possible to make the red function keys addressable if AtomCol > 10. It is obviously not compatible with the Atom. Another approach would be that the red keys are a combination of CTRL + number. So F1 sends CTRL+1 to the Atom; programs using the function keys can also be run on a normal Atom. That gives the opportunity to control the leds from software:

writing to the AtomCol (lower bits of #B000):
10: 1010 -> turn led 1 off
11: 1011 -> turn led 1 on
12: 1100 -> turn led 2 off
13: 1101 -> turn led 2 on
14: 1110 -> turn led 3 off
15: 1111 -> turn led 3 on
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:

User avatar
TheCorfiot
Posts: 671
Joined: Mon Jan 08, 2007 5:22 pm
Contact:

Re: Designing a new Atom main board

Post by TheCorfiot » Sun Mar 15, 2015 6:57 pm

Hi Dave

I did the rewiring on the fly tbh, just reading the matrix 1 column (blue wire) and then 1 row (yellow wire) at a time.
I didnt really document it sorry as i believe its a one off just to let me test and use the new Atom.

I hear you regarding the key positions for games so i used the following mapping.

All keys mapped one to one to Atom keyboard except.
Atom Lock became BBC Shift Lock
Atom Repeat became BBC Tab
Atom up down became BBC Caps Lock and BBC up and BBC down
Atom left right became BBC left and BBC right
Atom exp became BBC ^

And it seems to work well, i even wired in the Caps Lock LED as a Green Power LED.

Going forward though i think a PS2 interface has to be the way as we dont want to be stripping BBC Model B's for their keyboards.

Dare i say Electron, lol, think about it great desktop footprint for use as a keyboard only in it's original case, with an Atom logo covering Electron.
No thats a bit cruel too as we will then be gutting Elk's

I have thought about the type of PIC and firmware for a PS2 interface and surely we dont need to complicate it with timing concerns too much after all it is just going to mimic a human user and we are not particularly speedy lol.

So we need a PIC with lots of IO a PS2 input , then Read incoming PS2 data translate and set the correct IO word to the output ports to simulate a key press and maintain the state for a suitable time, then release and start again.

Phil...your board looks very interesting, how would we go about building one please?

TC :)

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

Re: Designing a new Atom main board

Post by hoglet » Sun Mar 15, 2015 7:07 pm

roland wrote:How should the BBC keyboard be connected to the CPLD?
Here's the schematic of the keyboard:
http://mdfs.net/Info/Comp/BBC/Circuits/BBC/bbckbd.gif

Here's how I think the CPLD would be connected to the keyboard:

Code: Select all

       CPLD Board     Beeb Keyboard
       ==========     =============     
              Clk  => 1MHz
             nRST <=  nRST
  BeebRowCol(6:0)  => PA(6:0)
         BeebData <=  PA(7)
     BeebLED(3:1)  => BeebLED(3:1)
               0V  => nKbEn
              N/C <=  CA2
roland wrote: I think it is also possible to make the red function keys addressable if AtomCol > 10. It is obviously not compatible with the Atom. Another approach would be that the red keys are a combination of CTRL + number. So F1 sends CTRL+1 to the Atom; programs using the function keys can also be run on a normal Atom. That gives the opportunity to control the leds from software:

writing to the AtomCol (lower bits of #B000):
10: 1010 -> turn led 1 off
11: 1011 -> turn led 1 on
12: 1100 -> turn led 2 off
13: 1101 -> turn led 2 on
14: 1110 -> turn led 3 off
15: 1111 -> turn led 3 on
This is a nice idea, but I don't quite see how it would work. The problem is the lower bits of #B000 are not present on the new Atom keyboard connector. What's present is the 10 outputs of the 7445, which in the CPLD is called AtomRow(9:0).

Dave

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

Re: Designing a new Atom main board

Post by hoglet » Sun Mar 15, 2015 7:14 pm

TheCorfiot wrote:Going forward though i think a PS2 interface has to be the way as we dont want to be stripping BBC Model B's for their keyboards.
The problem with a PC Keyboard is there are not enough keys horizontally to do an accurate mapping. In Atomulator, even the best mapping is very hard to use with most games.

At least the BBC keyboard has the right number of keys, and you frequently see the being sold individually on eBay. I picked up mine for £20.

The other think I'm interested in making is a BBC Keyboard -> PS/2 converter, so that I can use this with my AtomFPGA that has a PS/2 input.

Roland, do you have any New Atom PCB's left? :D

Dave

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

Re: Designing a new Atom main board

Post by roland » Sun Mar 15, 2015 8:33 pm

Hoglet wrote:This is a nice idea, but I don't quite see how it would work. The problem is the lower bits of #B000 are not present on the new Atom keyboard connector. What's present is the 10 outputs of the 7445, which in the CPLD is called AtomRow(9:0).
Actually, you could remove the 7445 and place some wires to bring the 4 bits to the connector. That is non-destructive. The CPLD should then also do the job of the 7445. This brings the lower bits of #B000 to the CPLD.
Hoglet wrote:Roland, do you have any New Atom PCB's left?
There's only one left :lol:
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:

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

Re: Designing a new Atom main board

Post by hoglet » Sun Mar 15, 2015 8:39 pm

roland wrote:
Hoglet wrote:Roland, do you have any New Atom PCB's left?
There's only one left :lol:
Go on then, I'll give it a new home, unless you have other plans for it.

Please let me know how much to send you.

Dave

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

Re: Designing a new Atom main board

Post by hoglet » Sun Mar 15, 2015 8:49 pm

I might order one of these for interfacing the BBC Keyboard:
http://www.seeedstudio.com/depot/XC9572 ... p-799.html
XC9572XL1_01.jpg
Dave

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

Re: Designing a new Atom main board

Post by roland » Sun Mar 15, 2015 9:14 pm

hoglet wrote: Please let me know how much to send you.
PM send.
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:

PhilYoung
Posts: 204
Joined: Sun Jun 12, 2011 5:55 pm
Contact:

Re: Designing a new Atom main board

Post by PhilYoung » Mon Mar 16, 2015 9:24 am

TheCorfiot wrote:
Phil...your board looks very interesting, how would we go about building one please?

TC :)
Hi,

Toner transfer, I was astonished at how well it works. I used parts of this system:

http://www.pcbfx.com/main_site/pages/st ... rview.html

which can be seen in use here: https://www.youtube.com/watch?v=I7NKZnsDoCA

I'll PM you the layout and design files if you like, but you need to be aware of the limitations.

Specifically:

1. Registration of the two sides. I do this by adding a few extra vias, etching one side, drilling through those vias and also through the print of the second side, and lining them up against a light source. This seems to get me close enough, but there is always a degree of misalignment.

2. Drilling the holes is a PITA. I do it manually with a dremel type drill, but it takes a lot of care. You can't use carbide drills manually either, they would certainly snap. I've ordered a cheap pcb drill from ebay, and I'll try mounting this on the back of the hot end carriage of my 3D printer. So I should be able to modify the G-code exported by the pcb software and use it to automate drilling, and I would then be able to use carbide drills. Even manually controlling the printer would be better than doing it manually.

3. Through Plating. Not present of course, so you need to either arrange use through hole components that allow you to solder top and bottom, or insert wire links. I believe some experiments have been done using conductive paint but I don't know if I'd trust this.

4. Not really a problem, but without tinning (which you can actually do yourself) the copper gradually tarnishes. So you get a sort of Steampunk look after a while.

Cheers,

Phil Young

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

Re: Designing a new Atom main board

Post by roland » Mon Mar 16, 2015 9:59 am

IIRC you also need an Arduino or so for your interface?
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:

User avatar
1024MAK
Posts: 9904
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Designing a new Atom main board

Post by 1024MAK » Mon Mar 16, 2015 10:07 am

PhilYoung wrote:4. Not really a problem, but without tinning (which you can actually do yourself) the copper gradually tarnishes. So you get a sort of Steampunk look after a while.
To keep the board looking clean, and to protect the copper use a PCB Lacquer.
Available from many suppliers, here are some links:
http://www.maplin.co.uk/p/maplin-pcb-lacquer-n67an
http://uk.rs-online.com/web/p/electroni ... s/0569290/
http://uk.rs-online.com/web/c/facilitie ... -lacquers/
http://www.rapidonline.com/mechanical-f ... ml-87-0670

Of course there are other suppliers :mrgreen:

Mark

PhilYoung
Posts: 204
Joined: Sun Jun 12, 2011 5:55 pm
Contact:

Re: Designing a new Atom main board

Post by PhilYoung » Mon Mar 16, 2015 10:18 am

roland wrote:IIRC you also need an Arduino or so for your interface?
Oh yes, I forgot to mention that ! I'm not suggesting it as a general solution, just what works for me. I suppose you could incorporate the ATmega168 into a stand alone design though, so a programmer would be needed. I think you can use another Arduino for this though.

You also need a laser printer and a laminator. And Ferric Chloride (or alternative etchant). And the patience of a saint to drill the holes (I used a surface mount socket for the 8816 to save drilling 44 holes).

Cheers,

Phil Young

PhilYoung
Posts: 204
Joined: Sun Jun 12, 2011 5:55 pm
Contact:

Re: Designing a new Atom main board

Post by PhilYoung » Mon Mar 16, 2015 10:22 am

1024MAK wrote:
PhilYoung wrote:4. Not really a problem, but without tinning (which you can actually do yourself) the copper gradually tarnishes. So you get a sort of Steampunk look after a while.
To keep the board looking clean, and to protect the copper use a PCB Lacquer.
Available from many suppliers, here are some links:
http://www.maplin.co.uk/p/maplin-pcb-lacquer-n67an
http://uk.rs-online.com/web/p/electroni ... s/0569290/
http://uk.rs-online.com/web/c/facilitie ... -lacquers/
http://www.rapidonline.com/mechanical-f ... ml-87-0670

Of course there are other suppliers :mrgreen:

Mark
Thanks. I quite like the antique patinated look though. It's not a problem once the soldering has been done, just aesthetics.

Cheers,

Phil Young

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

Re: Designing a new Atom main board

Post by roland » Mon Mar 16, 2015 1:56 pm

PhilYoung wrote:
roland wrote:IIRC you also need an Arduino or so for your interface?
Oh yes, I forgot to mention that ! I'm not suggesting it as a general solution, just what works for me. I suppose you could incorporate the ATmega168 into a stand alone design though, so a programmer would be needed. I think you can use another Arduino for this though.
OK, this will encourage Guido and me to continue with our PIC-project. We intend to use a small Microchip pic and a MT8816 (or equivalent) for this purpose. The PS/2 handling is already finished and we're waiting for the MT8816.

If we get this to work I will certainly take care of a bunch of professional produced PCB's and the programmed components. After all, I really enjoy all the attempts to find a keyboard replacement but fitting it into a nice case is also important. With a BBC keyboard you don't have a case. With a PS/2 keyboard you can at least mount the Atom in a rectangular box. The Atom-in-Electron is also nice but the Electron has only 56 keys while we need 60.
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:

User avatar
1024MAK
Posts: 9904
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Designing a new Atom main board

Post by 1024MAK » Mon Mar 16, 2015 2:38 pm

hoglet wrote:Mark and Bas, have you moved any of the key caps around? I'm interested in how close to the Atom layout you managed to come.
I have only placed a picture of an Atom between a Beeb and an Elk to see which is the closest fit (I have both a spare uncased Beeb keyboard and an Elk where the return key does not work).

The closest fit to the Atom layout is clearly the Beeb, so I had dropped the sacrifice the Elk idea. As I was not planning on using the Beeb keyboard with it's current matrix circuitry, yes I was going to move the key caps around, plus maybe make extra holes to relocate one or two key switches to better match the Atom keyboard layout.

However, a wicked thought went through my mind later on, what if I could transplant the modified Beeb keyboard into an Elk?

I have got distracted since, and have not followed up any of these ideas yet :(

Mark

PhilYoung
Posts: 204
Joined: Sun Jun 12, 2011 5:55 pm
Contact:

Re: Designing a new Atom main board

Post by PhilYoung » Mon Mar 16, 2015 3:19 pm

roland wrote:
PhilYoung wrote:
roland wrote:IIRC you also need an Arduino or so for your interface?
Oh yes, I forgot to mention that ! I'm not suggesting it as a general solution, just what works for me. I suppose you could incorporate the ATmega168 into a stand alone design though, so a programmer would be needed. I think you can use another Arduino for this though.
OK, this will encourage Guido and me to continue with our PIC-project. We intend to use a small Microchip pic and a MT8816 (or equivalent) for this purpose. The PS/2 handling is already finished and we're waiting for the MT8816.

If we get this to work I will certainly take care of a bunch of professional produced PCB's and the programmed components. After all, I really enjoy all the attempts to find a keyboard replacement but fitting it into a nice case is also important. With a BBC keyboard you don't have a case. With a PS/2 keyboard you can at least mount the Atom in a rectangular box. The Atom-in-Electron is also nice but the Electron has only 56 keys while we need 60.
I don't know anything about PICs, but I'm sure it is just as possible as with an ATmega. I can send you the (Arduino) code if that would help, I found a very simple PS/2 handler online, the normal libraries were quite large and did much more than needed. Then it's just a look-up table (two actually because I echo the output to the serial port for debugging).

One comment I have about the MT8816 I have used, it seems that with the output rows (X0 to X15), the row selected doesn't always match the one you would expect from the data sheet. It doesn't actually matter because that can be adjusted in the software, but I've checked it several times and it's definitely inconsistent. It's not just transposed address lines either.

So if you do use that chip it would be best to check for that before committing to having some boards made up.

Cheers,

Phil Young

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

Re: Designing a new Atom main board

Post by roland » Mon Mar 16, 2015 4:43 pm

Hi Phil,

PIC's are quite simple to program. We're using simple, plain assembly code. I'd love to see your code as we don't have anything for setting the matrix yet.

And thanks for the hint about the MT8816.

Greetings,
Roland
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:

PhilYoung
Posts: 204
Joined: Sun Jun 12, 2011 5:55 pm
Contact:

Re: Designing a new Atom main board

Post by PhilYoung » Mon Mar 16, 2015 5:52 pm

roland wrote:Hi Phil,

PIC's are quite simple to program. We're using simple, plain assembly code. I'd love to see your code as we don't have anything for setting the matrix yet.

And thanks for the hint about the MT8816.

Greetings,
Roland
Hi Roland,

I've attached the arduino code, the simplified PS/2 interface information and code is no longer online so I've attached my copy of it as well.

The 8816 is very easy to use, just set the address (7 bits) for the switch, set STROBE high, set the DATA to 1 for 'press' and 0 for 'release', set STOBE back to low and that's it. RESET high to clear all the matrix. Setup times are of the order of 10ns so I didn't need to put in any delays.

I'd be interested to see if you get the same problem with the 8816. I can't believe the data sheet is wrong, but I can't find any mistake either.

Good luck,

Phil Young
Attachments
interfacing-the-ps2-keyboard.zip
(100.5 KiB) Downloaded 38 times
Shield.txt
(6.9 KiB) Downloaded 38 times

User avatar
oss003
Posts: 3249
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: Designing a new Atom main board

Post by oss003 » Wed Mar 18, 2015 3:14 pm

Hi Roland,

there is a guy who connected a PS2 keyboard with a C64 using a M3493B2:

http://www.cbmitapages.it/tecnico/pckeyb.htm

Greetings
Kees

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

Re: Designing a new Atom main board

Post by roland » Wed Mar 18, 2015 4:41 pm

Hi Kees,

Guido has told me he almost has finished his design (mainly reading the keyboard) so he only has to control the matrix switch. According to his mail, this is a piece of cake.

If needed we will contact this guy, but we also have Phil's design which might even be more usable because he connects a PS/2 board to an Atom already.

Thanks anyway for posting this link.

Greetings,
Roland
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:

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

Re: Designing a new Atom main board

Post by roland » Fri Mar 27, 2015 7:29 pm

There is a small progress on the PS/2 interface. Guido has it almost working but there are still some issues to solve. It's mainly combinations with shift and a key and there are some problems with the cursor keys.

Next week we have our monthly meeting again and I expect to see some results 8)
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:

User avatar
TheCorfiot
Posts: 671
Joined: Mon Jan 08, 2007 5:22 pm
Contact:

Re: Designing a new Atom main board

Post by TheCorfiot » Fri Mar 27, 2015 8:54 pm

Excellent News Roly...

:D

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

Re: Designing a new Atom main board

Post by roland » Sat Mar 28, 2015 7:21 pm

Today I received a mail from Guido. He wrote me that he has found and fixed all bugs he still had in the interface. The only thing to solve is how the interface should behave if you want a sign like @ or : because these keys have "no shift" on the Atom.

BTW Guido has chosen for an interface to show the character that is on the key cap, and not exactly like the Atom keyboard mapping. This might not be the very best solution for all the games. On the other hand, most of the work is done in software, so you can modify it as you like.

Like I already wrote, we'll meet next Friday and then I can see it working and we can discuss the options we have for the remaining issues. I'll ask him for the schematic diagram so I can start designing a pcb.
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:

leendert
Posts: 3
Joined: Thu Mar 05, 2015 12:55 pm
Contact:

Re: Designing a new Atom main board

Post by leendert » Sat Mar 28, 2015 8:01 pm

Hi Roland,

That's great news!
Looking forward for an update on this subject.

Regards,
Leendert

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

Re: Designing a new Atom main board

Post by roland » Tue Mar 31, 2015 10:15 pm

Guido asked me to bring some ps/2 keyboards on Friday so we can do some (final?) tests with different types and brands of keyboards. Exciting [-o<

Btw I wonder how an usb keyboard with ps/s adapter behaves when connected to the interface....
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:

User avatar
1024MAK
Posts: 9904
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Designing a new Atom main board

Post by 1024MAK » Tue Mar 31, 2015 10:51 pm

roland wrote:I wonder how an usb keyboard with ps/s adapter behaves when connected to the interface....
A lot of USB keyboards and even some mice drop down to PS/2 mode if they fail to establish a link using USB. The "feature" is not always advertised or specified on the keyboard/mouse or it's in/on the instructions or box.

Mark

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

Re: Designing a new Atom main board

Post by hoglet » Wed Apr 01, 2015 9:10 am

Roland,

Which company did you use to manufacture your new Atom PCBs?

I'm looking at the options for getting a keyboard PCB made up. ITEAD studio in China is coming out cheapest for a 37cm x 10cm two layer, at £68.00 in shipping for 5 units.

http://pcbshopper.com/ seems a nice price comparison site.

I was hoping to be able to etch one myself, but that's looking a bit challenging now!

Dave

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

Re: Designing a new Atom main board

Post by roland » Wed Apr 01, 2015 9:22 am

Hi Dave,

Makepcb.com made my boards. They are a bit more expensive then ITEAD. I didn't found ITEAD and somebody recommended makepcb as quite cheap and good quality. However, there was one Atom with a broken track ...

I suggest you try ITEAD and share your results with us.

Greetings,
Roland
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:

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

Re: Designing a new Atom main board

Post by hoglet » Wed Apr 01, 2015 9:32 am

roland wrote:I suggest you try ITEAD and share your results with us.
OK, but I think this weekend I will have a go at making my own using a toner transfer process. I'll make the tracks pretty fat so there is lots of margin for error.

Dave

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

Re: Designing a new Atom main board

Post by roland » Wed Apr 01, 2015 3:27 pm

Well, if you make your own board, I will have my PS/2 interface made by ITEAD.
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:

Post Reply

Return to “acorn atom and acorn system series”