Author Topic: Schematic question  (Read 3277 times)

0 Members and 1 Guest are viewing this topic.

Offline krownedk1ng

  • Thread Starter
  • Posts: 9
Schematic question
« on: Thu, 05 January 2017, 22:13:47 »
Hi everyone,

I've been lurking around this forum and r/mk for a while now looking at how everyone has been making there keyboards and figured I'd learn what goes into making one myself by creating a schematic for a keyboard layout myself. Just for background, I have experience creating schematics and have experience in electronics, but my experience in microcontrollers is limited to doing basic things on an Arduino board.

I was able to create the keyboard matrix without any issues since that was simple enough.

.

What I'm having trouble with is the microcontroller part of the whole system. I pieced together part of the circuit where the 32u4 connects to the USB port and all the caps/resistors/fuses etc. I believe I laid that part out correctly, but feel free to point out any mistakes I may have made. The part I can't figure out is how you determine which row and column gets assigned to each pin. Am I correct in assuming that you just assign each pin however you want and then code in the corresponding pin to row/column designation? Or is there something more involved in it than that?

The main purpose of me doing this is just to learn and really nothing else at this time, since I know there are plenty of other premade options out there that are doing the same thing that I'm trying to achieve here. I tried to search through and make sense of a bunch of schematics but I pretty much hit a dead end with the pin assignments on the matrix part of the circuit and I'm not really sure what to search for in the forum either so any help would be appreciated.

Thanks in advance!


Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Schematic question
« Reply #1 on: Fri, 06 January 2017, 02:28:39 »
You're right - any I/O pin can be used for the matrix then in the firmware config you say what's where :)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline ErgoMacros

  • Posts: 313
  • Location: SF Bay Area
Re: Schematic question
« Reply #2 on: Fri, 06 January 2017, 12:08:32 »
1. You may want to look at the firmware you intend to use, assign their default pins just to make the config easier.
2. The I/O pins on processors mostly (all?) do digital I/O just fine, but some have special additional functions as well. Interrupts, PWM, Analog-to-digital, stuff like that.
  You may want to start with the "generic" ports and save the "special" ones for later in case you figure out a need for them.
Cheers!
Today's quote: '...“but then the customer successfully broke that.”

Offline krownedk1ng

  • Thread Starter
  • Posts: 9
Re: Schematic question
« Reply #3 on: Fri, 06 January 2017, 14:29:43 »
1. You may want to look at the firmware you intend to use, assign their default pins just to make the config easier.
2. The I/O pins on processors mostly (all?) do digital I/O just fine, but some have special additional functions as well. Interrupts, PWM, Analog-to-digital, stuff like that.
  You may want to start with the "generic" ports and save the "special" ones for later in case you figure out a need for them.
Cheers!


The only firmware tool that I found was the Easy AVR USB tool so I was thinking about just using that, unless there is something else I should be using.

That's a good point about the special pins as well. I didn't think about the other functionality of the pins that are available on these chips. I may be able to get my hands on an atmega32u4 breakout board soon and was thinking about wiring up the schematic that I'm messing around with.

From what I was able to piece together the Easy AVR USB tool would be the only thing I would need to program my breakout board, since the micro already came with a USB bootloader on there. Or do I need to install something like FLIP to flash the firmware?

Offline OttoPilot

  • Posts: 3
  • http://uncyclopedia.wikia.com/wiki/Otto
Re: Schematic question
« Reply #4 on: Sun, 08 January 2017, 14:52:54 »
Also something else to think about - depending on the PCB layout, your selection of pins can make your routing more or less complex.  Identify which pins you want to use for matrix processing in general (e.g. you have decided you don't need the special functions of that pin) and then make an initial assignment that seems good to you, see how your layout goes and then back annotate if there are some selections/changes that can make your routing cleaner / easier on the PCB.

WRT row/col - In my limited experience, matrix processing in the MCU firmware can be set to read/process any combination of port/pin assignments on GPIOs, so I wouldn't get too hung up on that.

Offline a-c

  • Posts: 196
  • Location: USA
Re: Schematic question
« Reply #5 on: Sun, 08 January 2017, 16:40:42 »
Adding a 10k resistor between PE2 and ground would protect it from being a direct short if it is ever set as an output high.

Offline krownedk1ng

  • Thread Starter
  • Posts: 9
Re: Schematic question
« Reply #6 on: Sun, 08 January 2017, 16:46:51 »
Adding a 10k resistor between PE2 and ground would protect it from being a direct short if it is ever set as an output high.

Good point. I'll update the schematic

Also something else to think about - depending on the PCB layout, your selection of pins can make your routing more or less complex.  Identify which pins you want to use for matrix processing in general (e.g. you have decided you don't need the special functions of that pin) and then make an initial assignment that seems good to you, see how your layout goes and then back annotate if there are some selections/changes that can make your routing cleaner / easier on the PCB.

WRT row/col - In my limited experience, matrix processing in the MCU firmware can be set to read/process any combination of port/pin assignments on GPIOs, so I wouldn't get too hung up on that.

I actually recently found the living PCB thread as well, and the cost for making your own PCB isn't really outrageous either. Knowing that the outputs can be configured later on in software makes the PCB layout useful. I was initially just going to layout a schematic and hand wire the keyboard to a breakout board, but based on what I've read so far, I'm gonna make my own PCB now.

Going forward I'll post all my questions in the PCB thread since my circuit questions were pretty much answered.

Thanks for all the help everyone.

Offline OttoPilot

  • Posts: 3
  • http://uncyclopedia.wikia.com/wiki/Otto
Re: Schematic question
« Reply #7 on: Sun, 08 January 2017, 20:56:54 »
The only firmware tool that I found was the Easy AVR USB tool so I was thinking about just using that, unless there is something else I should be using.

That's a good point about the special pins as well. I didn't think about the other functionality of the pins that are available on these chips. I may be able to get my hands on an atmega32u4 breakout board soon and was thinking about wiring up the schematic that I'm messing around with.

From what I was able to piece together the Easy AVR USB tool would be the only thing I would need to program my breakout board, since the micro already came with a USB bootloader on there. Or do I need to install something like FLIP to flash the firmware?

Keyboard Firmware:
A lot of people use TMK https://github.com/tmk/tmk_core and https://github.com/tmk/tmk_keyboard
and QMK https://github.com/jackhumbert/qmk_firmware.

I would look into those too and see which one will work best for you, including Easy AVR.

Programming:
If you use the stock bootloader that comes from Atmel, you can use DFU protocol over USB to your computer using a program like avrdude (I think v6.1 or higher) or you can install dfu-programmer.  Google should turn up links for both of those.


Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: Schematic question
« Reply #8 on: Mon, 09 January 2017, 14:24:57 »
Is that a minus or a plus on your capacitors' symbols? The positive is usually marked as such. If that's the case, your capacitors are oriented upside down.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline krownedk1ng

  • Thread Starter
  • Posts: 9
Re: Schematic question
« Reply #9 on: Mon, 09 January 2017, 14:44:06 »
Is that a minus or a plus on your capacitors' symbols? The positive is usually marked as such. If that's the case, your capacitors are oriented upside down.
Actually, it's neither. Eagle has a little cross on all the symbols. You'll see them on the resistors, fuses, etc as well.

Sent from my SM-G900V using Tapatalk


Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: Schematic question
« Reply #10 on: Mon, 09 January 2017, 14:46:18 »
Is that a minus or a plus on your capacitors' symbols? The positive is usually marked as such. If that's the case, your capacitors are oriented upside down.
Actually, it's neither. Eagle has a little cross on all the symbols. You'll see them on the resistors, fuses, etc as well.
Bad bad Eagle. Safe to ignore my post then.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff