English Amiga Board


Go Back   English Amiga Board > Support > support.Hardware

 
 
Thread Tools
Old 24 November 2019, 23:30   #1
Mikerochip
Registered User

 
Join Date: Sep 2016
Location: Ireland
Posts: 213
Can anyone critique my first PCB design??

I'm not sure where to put this!


But, if it's ok here:


I've just designed my first PCB:


It's an arduino joystick! You can use it to create a 1-16 button USB joystick, which should work as a standard HID joystick, based on the Arduino ATMEGAU4 joystick library (Using code from JMTW000)



The fun thing is it has a rotary encoder, to play arcade spinner games with too!


It's not my code: It comes from here, but has a joystick added.


But! The fun part (for me anyhow!) as I designed it, was I decided to add a standard Atari/Amiga 2 button Joystick port.


So, you can build the stick, connect it to the PC, and use it as a USB joystick with spinner.


Or!
Connect a standard DB9 joystick to the PC, and use it as a usb joystick.
(Or do both. Build it, and then plug in DB9 joystick too!)


OR, if it's possible, (though I don't think it is):

Build the stick, and use a DB9 cable to connect the arcade style stick to the Amiga/Atari etc.


I think though, since the Arduino uses 220mA on the 5V line, the amiga wouldn't give out enough to power it?


I haven't tested though, exactly how much power the Arduino uses.



Can anyone take a look at my Fritzing design (or gerbers I suppose) and see if I've made any obvious errors?


I mostly wanted to do this, then design a 2 player one using 2x CD4021 chips (which I need to figure out how to code for, but it looks easy enough)


And then expand it to work either as a USB Joystick, or, USB Keyboard.


Again, seems easy enough, but, it'll still take me a while!
Mikerochip is offline  
Old 25 November 2019, 12:42   #2
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 4,525
I can't see the design in that post... But well done anyway

I'm not really sure what you mean by coding for CD4021 chips - From what I remember they're standard CMOS logic chips, possibly a serial shift register? But I would avoid using CMOS chips in situations like this if you intend to have sockets for connecting external controllers to them, since they're sensitive to ESD. I'm sure an equivalent 74LS chip could be found easy enough, and will be more robust as a result.
Daedalus is online now  
Old 25 November 2019, 20:01   #3
nogginthenog
Amigan

 
Join Date: Feb 2012
Location: London
Posts: 911
Can't see the design either. For PCB critique you could try Reddit or maybe the EEVblog forums?
https://www.reddit.com/r/PrintedCircuitBoard/

Normally Arduino's have a voltage regulator that's not needed (power through VIN instead). Measure the current with a multimeter and see what you get.
nogginthenog is offline  
Old 25 November 2019, 21:29   #4
Mikerochip
Registered User

 
Join Date: Sep 2016
Location: Ireland
Posts: 213
Quote:
Originally Posted by nogginthenog View Post
Can't see the design either. For PCB critique you could try Reddit or maybe the EEVblog forums?
https://www.reddit.com/r/PrintedCircuitBoard/

Normally Arduino's have a voltage regulator that's not needed (power through VIN instead). Measure the current with a multimeter and see what you get.

Thanks!


Gah. I forgot to link the images. (I actually forgot to upload the images too!)


OK SO: https://imgur.com/Dajk3xG


and 2 player: https://imgur.com/2XibHGr


Quote:
Originally Posted by Daedalus View Post
I'm not really sure what you mean by coding for CD4021 chips - From what I remember they're standard CMOS logic chips, possibly a serial shift register? But I would avoid using CMOS chips in situations like this if you intend to have sockets for connecting external controllers to them, since they're sensitive to ESD. I'm sure an equivalent 74LS chip could be found easy enough, and will be more robust as a result.

@Daedalus, I meant: connect up the 4021's, and then figure out how to read the buttons and work it into my Arduino code


You're correct, it's a serial shift register. Any other suggestions welcome!


I see there's a 75HC4020 that seems quite similar, but, I can't really do SMD stuff.
Mikerochip is offline  
Old 26 November 2019, 12:17   #5
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 4,525
I think I see what you mean - you're looking to translate the 9-pin joystick input into a serial stream of bits read by the Arduino, right? Have a look at the 74LS165. It carries out that very function in the CD32 control pad to read all the extra buttons, is more robust than the CMOS chips will be, and is available as a through hole DIL part.
Daedalus is online now  
Old 26 November 2019, 20:24   #6
nogginthenog
Amigan

 
Join Date: Feb 2012
Location: London
Posts: 911
Design looks reasonable. Most people use 45 degree tracks but it's not a big issue. I had my first ever boards manufactured by JLCPCB just a week ago and they turned out nice.

You may be able to reduce the current by powering via the VIN pin instead of the 5v regulated pin. Do some reading and measurements!
nogginthenog is offline  
Old 26 November 2019, 21:42   #7
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 4,525
Yeah, at those sorts of signal speeds, the angles don't matter, but for purely aesthetic reasons I tend to use orthogonal tracks too, while also avoiding right angle corners. Nothing major to worry about there though. I haven't looked at the pinouts of the chips so I don't know what the functions of the unconnected pins are, but it's very important to not leave inputs unconnected, especially with CMOS chips.
Daedalus is online now  
Old 26 November 2019, 23:23   #8
Mikerochip
Registered User

 
Join Date: Sep 2016
Location: Ireland
Posts: 213
Quote:
Originally Posted by nogginthenog View Post
Design looks reasonable
Thanks


Quote:
Originally Posted by nogginthenog View Post
Most people use 45 degree tracks but it's not a big issue.
Why so?


Quote:
Originally Posted by nogginthenog View Post
I had my first ever boards manufactured by JLCPCB just a week ago and they turned out nice.

Cool! Mine should be here next week, I'm hoping.



Quote:
Originally Posted by nogginthenog View Post
You may be able to reduce the current by powering via the VIN pin instead of the 5v regulated pin.

It's not really an issue for what I'm doing at the moment, but thanks. It may well be, if I decide to make it into an Amiga Joystick.


I'd already read about reducing the current. Someone did the same thing with another Arduino, and reduced the load from 280 to 50mAh.
I'm not sure I want to do it, really, it was just a thought


I would like to have a go at maybe making something similar, but for a CD32 joystick. If so, then, I need to get cracking.
It looks like I may need to remove the voltage regulator from the arduino altogether. I don't know if different boards have different loads, too.


Quote:
Originally Posted by Daedalus View Post
Yeah, at those sorts of signal speeds, the angles don't matter, but for purely aesthetic reasons I tend to use orthogonal tracks too, while also avoiding right angle corners.

I've seen Arduino chips parallel with boards, and chips at 45 degrees. I guess it matters then, after some certain threshold?


Electrons just don't like right angles?!



Quote:
Originally Posted by Daedalus View Post
I haven't looked at the pinouts of the chips so I don't know what the functions of the unconnected pins are, but it's very important to not leave inputs unconnected, especially with CMOS chips.

Just to clarify, the top picture, which has the 9 pin connector, has nothing on the board except the Arduino, DR9, and a bunch of screw terminators.
Nothing too complicated. It's basically just a labelled breakout board.



The bottom picture, has only an output to USB to the PC. Nothing else is involved, just switches, the 2x 4021s, 10k resistors and a bunch of microswitches.



Pins 7,6,5,4,13,14,15 are the input pins. They're all connected to vcc via 10k resistors. I wired it like an example Arduino diagram I have for 2x CD4021s.



So some more info: What I want is to build something to play games with!


For the top one: Joystick directions, rotary encoder, 10 buttons, then two extra switches. One momentary, one not.


The buttons/joystick work as a HID joystick/buttons, and then, when the momentary one is held, each button has a second function.


Button 1 becomes Exit program, and then others become volume up/down, etc etc. It allow me to program in some fancy stuff to make life a little easier for running this from an arcade cabinet. Or armchair.



The toggle, is to switch between HID joystick, and keyboard. For standard gaming / MAME compatibility. So, instead of a HID joystick, it's now a standard keyboard. (Using the default mame layout). Again, to make life easy. I already have a config for Mame written for a joystick, but, I just wanted to see if I could do this via code, is all.
And, some emulators don't like joystick input, they're keyboard only.



The 2 player version is exactly the same, but the state shift registers have the inputs for player 2.


So.
Simple enough!


Thanks for looking and the suggestions.
Mikerochip is offline  
Old 27 November 2019, 11:05   #9
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 4,525
Good stuff, you have it covered so. At high speeds, electrons start to do funny things in conductors, and things like track length, width, spacing and sharp angles start to have an effect. You'll see that on the Arduino, motherboards and so on. The A4000 even has curved traces to avoid using angles on some of the lines dealing with the RAM. Below those sorts of speeds though, it's basically an OCD or aesthetic thing.
Daedalus is online now  
Old 27 November 2019, 19:51   #10
nogginthenog
Amigan

 
Join Date: Feb 2012
Location: London
Posts: 911
It's definitely a OCD thing

One thing I can add is make your pads big enough.
I soldered up a board last weekend that had unnecessarily tiny pads around the pins. Worked first time though.
nogginthenog is offline  
Old 02 December 2019, 19:24   #11
Mikerochip
Registered User

 
Join Date: Sep 2016
Location: Ireland
Posts: 213
Quote:
Originally Posted by nogginthenog View Post
One thing I can add is make your pads big enough.

I don't know how I'll give what I have a go, and see what it looks like in real life. And look more at if Fritzing can do things like that easily, for pre-made components.


Quote:
Originally Posted by Daedalus View Post
The A4000 even has curved traces to avoid using angles on some of the lines dealing with the RAM.

That's a hell of a thing


In a digital world, nice to see some curves


I did actually know the thing about the right angles and electrons, I'd just forgotten. I remember years ago, my friend telling me about the problems Intel were having with, I think, the 45 nanometer fab, about electrons just not following classical relativity rules. Like, taking only one direction at a T junction, or jumping over traces where there were joins, and just continuing on, as if nothing happened. Essentially, that tiny piece of (I think it was aluminum or was it copper they used for traces?) metal was non conductive. Crazy.


@Daedalus does VO2 make life easier for computer circuits?
(I don't know how to do subscript to write it properly)


https://newscenter.lbl.gov/2017/01/2...adium-dioxide/



Thank you both, that was some interesting information though!
Mikerochip is offline  
Old 02 December 2019, 22:05   #12
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 4,525
Sounds very interesting Yeah, you can check out the A4000 board layout on amigapcb.org, scroll down to the bottom and see the curves
Daedalus is online now  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Amiga PCB Explorer (A4000 Desktop PCB Rev B) SuperPlay Amiga scene 6 04 January 2018 15:21
Best free PCB design software? Akira Hardware mods 33 22 September 2017 21:19
Wrinkles in PCB PowerPie5000 support.Hardware 10 11 December 2010 15:21
Looking for PCB wizzard kolla request.Other 5 11 August 2010 12:12
Starfield in Blitz Basic - helpful critique sought Anding Coders. General 10 13 January 2009 21:46

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 19:25.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.07759 seconds with 13 queries