Need Help with Cherry PCB

Index

25 Jul 2012, 05:56

Hi all,

Been working on this PCB for the past week using KiCAD. I got my layout done, I just need to add in the Teensy into the PCB. However I want to use the SMD components from the teensy. I've got the correct microcontroller on it already, I just need to mini usb and the rest of the Teensy components on it in the correct spots.

I'm planning on putting this PCB in a Poker case and I want to be able to connect a ICSP on the bottom through the hole in the Poker case.

I was wondering if someone could help me place the rest of the components of the Teensy.

Thanks,
Index

Edit:
The Teensy I want to place on the PCB is the Teensy 2.0 to be specific. The schematic can be viewed here: http://www.pjrc.com/teensy/schematic.html

Edit1:
Also, I think the CUI might be a better alternative to the Teensy since it has more documentation on it. Any thoughts?
http://www.create.ucsb.edu/~dano/CUI/
Attachments
Index Keyboard.zip
KiCAD project files for the Keyboad
(94.33 KiB) Downloaded 217 times

Index

27 Jul 2012, 06:15

Here's the updated project files with both the breakout board and the cherry switches.

Can someone please look over the schematic? I know nothing about pcb design and I'm pretty much doing this for the first time.
Attachments
Index Keyboard.zip
(102.41 KiB) Downloaded 250 times

bpiphany

27 Jul 2012, 07:06

I had a quick look and it looks quite right, but don't take my word for anything... Also I don't have all the standard libraries installed so some components only show up as boxes with question marks in them. It would help if you kept all library files you are using in the project library. And remove all other library files, KiCAD get so grumpy when it doesn't find them all =) (And you also don't need to spill your username and OS..)
  • There are still some wires that look like they end up in the middle of nowhere. And I think it is customary to only use vertical and horizontal wires with 90° bends, for a good reason...
  • You can tie HWB to ground, through a resistor. It only needs to be grounded for the chip to call the bootloader on reset. That is unless you want to use that pin for something else. Then you need to have a jumper or button tying it down, while resetting.
  • Keyboard LEDs?
  • You can use the pins connecting to the ISP interface for other tasks in general use (that is the whole idea..)
  • 3.3 volts? Are you going to want to use that, otherwise you can design that whole part away as well.
This how it renders in KiCAD to me at the moment
index.png
index.png (44.13 KiB) Viewed 9230 times

Index

27 Jul 2012, 07:31

Here are the project files with the required .lib and .mod files. Sorry, about that. Also, what are you talking about spilling my username and os, where is that stored?
Attachments
Index Keyboard.zip
(279.21 KiB) Downloaded 227 times

Index

27 Jul 2012, 07:43

bpiphany wrote:
  • There are still some wires that look like they end up in the middle of nowhere. And I think it is customary to only use vertical and horizontal wires with 90° bends, for a good reason...
Sorry about that, I literally just did what u told me to do in the geekhack forum and just connected the wires from the cherry switches to the microcontroller.
bpiphany wrote:
  • You can tie HWB to ground, through a resistor. It only needs to be grounded for the chip to call the bootloader on reset. That is unless you want to use that pin for something else. Then you need to have a jumper or button tying it down, while resetting.
I do want to be able to reset the microcontroller so I can be able to reprogram it. Is that what you mean?
bpiphany wrote:
  • Keyboard LEDs?
I don't want any keyboard LEDs, except for the microcontroller so I can see visual feedback when I'm reprogramming the microcontroller.
bpiphany wrote:
  • You can use the pins connecting to the ISP interface for other tasks in general use (that is the whole idea..)
Oh really? Well, I want the ISP pins there so I can reprogram the microcontroller.
bpiphany wrote:
  • 3.3 volts? Are you going to want to use that, otherwise you can design that whole part away as well.
I don't believe so, I just want a USB keyboard where I can connect an ICSP in order to program it.


Thanks for all the help bpiphany (formally PrinsValium), I know it must be very hard to stay patient with me. I talked to you before about designing a pcb on geekhack after looking at your symmetric stagger keyboard and pcb diy guide.

bpiphany

27 Jul 2012, 08:06

HA, don't worry I'm quite patient, and I like to teach and help out =D I am no electrical engineer myself, but I think it looks tidier and easier to follow when everything is laid out straight. For quick and dirty prototyping there are of course no rules...

When you press reset the controller looks at the HWB pin. If it is high the controller only restarts the program (I think, never did that actually), and if it is low the controller starts running from the memory address where the bootloader is located.

The bootloader is used to transfer files via the USB port. The other way to program the controller is to use a serial programmer and the ISP interface (in system programming), this is also good if you for some reason want to change the fuse bits since this can't be done via the bootloader. (There is parallel programming as well, but I have never used that.)

You don't even need to disconnect the unit to be able to program it using the ISP programmer. The programmer just jumps in and takes over. The rest of the design may get very confused while the programmer is talking to the chip perhaps, if you've got anything listening on those wires.. But that shouldn't be a problem here.

You may want to square off your matrix a bit, dropping the two rightmost columns since they only have 3 switches in total, and put those switches somewhere else.

The absolute path to the library files are stored, so your windows username shows up there =) By the way you still need to tell KiCAD where your library files are at, under "Preferenced->Library". There you will also see which "standard" libraries that are included. The power connections are from one of them, and I don't have them installed. So those also still do not render...

Generally I recommend taking a look into the files with a text editor, they are not too complicated and it reveals a little of how things work under the hood. Also it is possible to quickly copy and paste together your own library files including only what you need. They are pretty forgiving on white spaces also, spaces or tabs doesn't matter, neither does the number of newlines.

Index

29 Jul 2012, 06:09

Here's an updated version, tried to follow ur advice bpiphany.
Attachments
Index Keyboard.zip
(278.56 KiB) Downloaded 205 times

bpiphany

29 Jul 2012, 08:12

I think it looks pretty good, the library paths still are messed up, but let's not focus on that =)

You probably don't want to connect the unused D0, D1 pins directly to ground. Even if you are not going to use them. If they are accidentally set to high output that would probably be bad. Leave them floating or have a 1k-10k resistor in series.

And, really, use some of the free pins for some switch mounted LEDs. It won't hurt you to have them there if you ever want them. Actually why not use every free pin for this purpose, or come up with some other use for them. No reason leaving IO-pins unused =)

Generally, try to make sure why every single component is there, and understand it's purpose. Ask questions if you can't figure it out. Why are C4-C7 there for instance?

You are probably going to want to move things around when routing, moving keys in the matrix, swapping controller pins and such. All to make routing easier and tidier.. And route by hand, it's not too hard and the result often gets a lot tidier. I sometimes use the FreeROUTE tool to do it by hand. It's pretty nifty to have the traces floating and making room while drawing out new ones. But that is only to sketch out the routing, after that I always redraw everything by hand in KiCAD.

I should work some more on the KiCAD tutorial =P There are some good-to-know keys to know when routing in KiCAD.
  • '/' switches the end on which traces fold
  • 'End' ends the trace at the current mouse pointer location
  • 'Del' removes the last trace section while laying out a trace, and removes a complete track otherwise
  • 'BackSp' removes the last trace section while laying out a trace, and removes only a section of a track otherwise
  • 'Esc' cancels the trace
  • 'V' places a via and switches layer, with two layers that is all you need.
  • 'PgUp/PgDn' switches between layers as well, placing a via.
Edit: Oh mg I just found out about the hotkey editor... You can set them yourself under "Preferences->Hotkeys->Edit Hotkeys"

Index

30 Jul 2012, 17:28

Hmm, I think for the free pins, i'll connect a dip switch. Just like how to Poker has a dipswitch.

I think I can connect a 3 switch Dip Switch using the ICSP pins and the 3 Leftover pins.

Index

30 Jul 2012, 19:57

New update!

1) Added dip switches
2) Pruned some outdated files
3) Created a github repo for the entire project: https://github.com/callenrosario/index_keyboard

bpiphany

31 Jul 2012, 12:59

Much better =D

I think for the DIP-switches, you really only need to connect one of the sides to GND, and use pull-up resistors on the pin you connect to the other side. That way you will know which way the DIP is switched, and it gives you double the number of DIPs =) And I don't think it is a very good idea to use the AREF as an I/O-pin...

That 500mA fuse is probably pretty unnecessary, and tie HWB to GND through a 1k resistor straight away, if you are not planning on using it for anything.. You can lose the power indication LED without shedding any tears, but I still think other indication LEDs are useful =P

There is no PCBnew (.brd) file in the github repository...

Index

31 Jul 2012, 17:58

bpiphany wrote: I think for the DIP-switches, you really only need to connect one of the sides to GND, and use pull-up resistors on the pin you connect to the other side. That way you will know which way the DIP is switched, and it gives you double the number of DIPs =) And I don't think it is a very good idea to use the AREF as an I/O-pin...
Didn't know you could do that, that's very cool. I read more about it here: http://www.thebox.myzen.co.uk/Tutorial/Inputs.html
bpiphany wrote: That 500mA fuse is probably pretty unnecessary, and tie HWB to GND through a 1k resistor straight away, if you are not planning on using it for anything.. You can lose the power indication LED without shedding any tears, but I still think other indication LEDs are useful =P
What is a 500mA fuse used for anyway?
bpiphany wrote: There is no PCBnew (.brd) file in the github repository...
Ah yeah, I didn't add it because it was out of date. I'll create a new one tonight after work.

bpiphany

31 Jul 2012, 19:52

My guess is the fuse is on the breakout board to protect the USB port when messing around with peripherals connected to it. With a well functioning keyboard you should of course never exceed the 500mA USB limit. Accidentally shorting out two pins on a breakout board I could see happening...

I thought that was the case with the missing .brd file. No worries there then =)

Index

31 Jul 2012, 20:07

Ahh kk, makes sense. I now know what a fuse does.

Well I'm pretty sure this pcb is going to be pretty much done by the end of this week.

Since it's designed to fit in poker cases, I wonder if a groupbuy (like the Phantom) would be popular. Or course, I would not want to deal with that at all. =/

bpiphany

01 Aug 2012, 00:13

Just offer the PCB, that should be simple enough.. Perhaps components as well. I think you can actually compose custom sets of components, for an extra cost, at some of the large suppliers. A lot of people will probably be a little bit scared of the SMD soldering as well =P But they shouldn't be, a decent, small tip, soldering iron and it's a breeze. And no bending and cutting component leads! Do everything SMD, but don't go smaller than 0603... (they are still tiny)

And you really want to get the number of PCBs up, they drop a lot in price for every extra at low numbers. Ordering just one or two is silly expensive =P

Index

01 Aug 2012, 01:01

Should I get SMD diodes also? Probably should.

Index

01 Aug 2012, 04:42

Also, bpiphany do you have a KiCAD .lib and .mod file for a pull up resistor?

Index

01 Aug 2012, 06:48

Nevermind, just found out a pull up resistor is the same as a regular resistor...

bpiphany

01 Aug 2012, 07:49

There are internal pull-up resistors inside the ATmega32u4, so you won't need any extra. You could do extra holes for through hole diodes, but really SOD-123 ones are quite large.

Unfortunately I didn't add anything for reference in this photo.
Top left SOD-123, Bottom left SOD-323, middle DO-35, Top right 0402, middle right 0603.
Top left SOD-123, Bottom left SOD-323, middle DO-35, Top right 0402, middle right 0603.
SMDs.jpg (78.7 KiB) Viewed 9017 times

Index

01 Aug 2012, 08:34

Updated the schematic. =)

Index

03 Aug 2012, 01:28

So, I think I'm almost done with this. I just need to figure out the correct spacing between the cherry mx footprints.

bpiphany

03 Aug 2012, 02:50

For spacings I made a spreadsheet of the distances. The distance between two locations should be the average of their widths, e.g. the distance between a 1 unit and a 1.75 unit key is (1+1.75)/2*0.75" = 1.03125" It's a little bit trickier to get this right when starting a row with a non-1 unit key...

bpiphany

03 Aug 2012, 10:31

Did I point you to my KiCAD tutorial files on github already? I added frames to the Cherry footprints there to make it obvious that they are correctly spaced. I really should continue writing on that thing today...

rodtang

03 Aug 2012, 12:31

bpiphany wrote: I really should continue writing on that thing today...
You really shoud :D, your stuff is a really good resource when designing keyboards.

bpiphany

03 Aug 2012, 15:10

rodtang wrote:
bpiphany wrote: I really should continue writing on that thing today...
You really shoud :D, your stuff is a really good resource when designing keyboards.
There, did something productive today at least =D This whole ErgoDox business sort of came in between...

Index

03 Aug 2012, 18:01

bpiphany wrote:Did I point you to my KiCAD tutorial files on github already? I added frames to the Cherry footprints there to make it obvious that they are correctly spaced. I really should continue writing on that thing today...
Omg, can I steal some of those files!??!?!

Edit: I'm stealing all of it.

bpiphany

03 Aug 2012, 21:17

Anything you don't pay to keep as secrets on github I think is public domain, or something like that. Feel free to grab whatever you like =D

Index

08 Aug 2012, 08:05

New update!

- Added .brd and .net files.
- Most of the .brd is done, just need to do the following:
1) change the spacebar footprint to 7.00u.
2) change the dip switch from a 3 to a 4.
3) place all the resistors
4) figure out the correct placement for the mini usb
5) change all the diodes to SMT

bpiphany

08 Aug 2012, 11:41

First I was like "Am I the only one OCD enough to put at least one switch on an integer coordinate.." Then I realized you had been using millimeters, which of course is honorable =D Keyboards seem to be standardized in inches though. And key spacing is 0.75" which is equal to 19.05mm. You have been using 19.00 which I am sure will be just fine. The individual locations however don't in any way line up with the numbers in my spreadsheet, so you'll be all on your own verifying their correctness ;)

Over 14 key spacings there will be a difference of ~0.5mm, but I have no idea if the Poker was designed in inch or millimeter... You will need mounting hole locations as well as the USB connector location. I did some measurements of them all once. They haven't been tested or verified, but I can probably round them up from my notes...

I think you are using some of my own old diode footprints. If I were you I would make them a bit wider and make the annulus of the pads a bit skinnier. Perhaps 0.3" spacing and 0.07" size, and round/square.

To enter the bootloader you will be required to have the HWB DIP switch set to ground. I would tie HWB to ground through a resistor (1-10k) and forget about it. You have all those ISP pins that you could use instead. Or use one of them for the LED and you will be sure not to short one of them to GND through the DIP switches. Actually PB4 is free, so just use that one instead =P

Edit: Saw you were going to switch to SMD diodes. So that comment won't matter much. You can do the same for resistors. I think 0603s can usually handle the effect a LED line will generate over it. But you may want to verify that. There is one thing that is actually nice with through hole components: It is a lot easier to fly wire things when you designed them erroneously =P

Index

09 Aug 2012, 06:07

Moar Updates!!:

Completed:
- Fixed the layout of the cherry mx footprints (based on .75" instead of 19mm).
- Swapped all through-hole diodes with SOD-123 diodes.

Todo:
- Fix spacebar footprint (still 6.25u, needs to be 7.00u).
- Place the USB footprint.
- Place all resistors, diodes, capacitors, crystals, and the jumper(?) on the backside of the PCB.
- Route all the wires.

Problems:
- Seems all the diodes are not wired up (I have no idea why this happened).
- I only have a rough idea of where to place the USB from pictures of Poker PCBs, still need an exact measurement.
- I have no idea how to edit the drawings for the spacebar to make it into a 7.00u spacebar (can only move components, can't seem to extend the drawings).

Post Reply

Return to “Workshop”