-
Notifications
You must be signed in to change notification settings - Fork 2
Add improved silkscreen, DigiKey BOM, Linux build script and update README #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
danboid
wants to merge
33
commits into
rfmerrill:main
Choose a base branch
from
danboid:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
967d543
Revert to first revision of PCB
danboid fda3304
Move U3 slightly to fix a thermal relief error
danboid 3246eda
Add extra labels to front silkscreen
danboid 77c275c
Add version number to front silkscreen
danboid a7d22d8
Add M2 mount holes
danboid 075283f
Add buttons to silkscreen
danboid f709e05
Add Linux build script for ATtiny404 code
danboid 386719f
Use -O3 option for Linux build script to match VisualC project build …
danboid 49959db
Round off PCB corners
danboid 07a9dfe
Update build script to remove old build files before building
danboid 9db7ab8
Add main.hex controller firmware
danboid d5a5f6d
Add programming and wiring instructions to README
danboid e9a4cf1
Second revision of silkscreen
danboid 5c9a82c
Update README
danboid b7791f4
Add gerbers zip file for v1.0
danboid a507d83
Add DigiKey BOM
danboid c1dc331
Change avrdude example command in README to use usbtiny config
danboid d95c76e
Add Arduino project files
danboid 742dd46
Add tested avrdude instructions and UPDI wiring images
danboid 3f62096
Add instructions for finding correct serial device
danboid 93959a3
Add note about required PCB components for programming the ATtiny
danboid 32c6cff
Remove link to old OSHpark board
danboid 6d4fe84
Rename MD connector pinout image
danboid f2e0aa4
Add csv BOM
danboid 826f574
Add credits
danboid f84779a
Update README to note the Spectrum Next is compatible
danboid 440b918
Update README with a photo of a wired joystick and buttons
danboid e18c318
Remove duplicate connector image
danboid ad83391
Add Manufacturer and Manufacturer Product Number columns to BOM files
danboid 30fb2c5
Add disclaimer to README
danboid 1da7d40
Move images into images subdir
danboid 962a242
Tweak build script
danboid 3667c48
Remove duplicate images from root dir
danboid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| Digi-Key Part Number,Quantity,Reference,Value,Manufacturer,Manufacturer Product Number,Description,Datasheet | ||
| 478-KGM21NR71H104KTCT-ND,10,"C1,C2,C3",0.1u,KYOCERA AVX,KGM21NR71H104KT,CAP CER 0.1UF 50V X7R 0805 – Only 3 needed but cheaper to buy 10 than 3,~ | ||
| A122908-ND,1,J1,CONN HEADER VERT 14POS 2.54MM,TE Connectivity AMP Connectors,826632-7,"Connector Header Through Hole 14 position 0.100"" (2.54mm)",~ | ||
| 2057-PH1-09-UA-ND,1,J2,CONN HEADER VERT 9POS 2.54MM,Adam Tech,PH1-09-UA,"Connector Header Through Hole 9 position 0.100"" (2.54mm)",~ | ||
| 2057-BHR-06-VUA-ND,1,J3,CONN HEADER VERT 6POS 2.54MM,Adam Tech,BHR-06-VUA,"Connector Header Through Hole 6 position 0.100"" (2.54mm)",~ | ||
| A102341CT-ND,12,"R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11,R12",75k,TE Connectivity Passive Product,CPF0805B75KE1,"75 kOhms ±0.1% 0.1W, 1/10W Chip Resistor 0805 (2012 Metric) Thin Film",~ | ||
| 296-CD74HC257M96CT-ND,2,"U1,U3",74HC257,Texas Instruments,CD74HC257M96,Multiplexer 4 x 2:1 16-SOIC,http://www.ti.com/lit/gpn/sn74LS257 | ||
| ATTINY404-SSNRCT-ND,1,U2,ATTINY404-SSNR,Microchip Technology,ATTINY404-SSNR,"AVR tinyAVR™ 0, Functional Safety (FuSa) Microcontroller IC 8-Bit 20MHz 4KB (4K x 8) FLASH 14-SOIC",http://ww1.microchip.com/downloads/en/DeviceDoc/50002687A.pdf |
|
danboid marked this conversation as resolved.
|
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,61 @@ | ||
| # genesis_6button | ||
| Simple PCB + ATTiny404 code for a 6-button mega drive controller. | ||
| # Six button Sega Mega Drive / Genesis controller board | ||
|
|
||
| This is a KiCad project for a board and accompanying ATTiny404 code to implement a replacement for the custom chip in the 6-button mega drive/genesis controller. | ||
| This repository contains a KiCad project for a six button Sega Mega Drive / Genesis controller board as well as ATTiny404 micro controller code to implement a replacement for the 6 button Sega Mega Drive controller's custom chip. This board is also compatible with the ZX Spectrum Next and its clones. | ||
|
|
||
| **Note: the `main` HEAD is not necessarily tested! Tested revisions of the board+firmware will be tagged** | ||
|
|
||
| Latest tested fab here: https://oshpark.com/shared_projects/aK2wBkfg | ||
| ## How do I program the controller? | ||
|
|
||
| Currently there is a 14-pin dual row header used for the buttons because I was unaware of the brook 20 pin header at the time. I might add that pinout to future boards. | ||
| **DISCLAIMER: This project is provided "as is" for educational purposes only. The authors shall not be held liable for any damage to equipment, data loss, or personal injury incurred through the assembly or use of this project. Proceed at your own risk.** | ||
|
|
||
| The ATtiny404 uses UPDI (Unified Program and Debug Interface) for programming, not ISP like older AVR MCUs. | ||
|
|
||
| There are several ways to program the ATtiny404 but probably the most affordable way is to use **avrdude** with a USB serial adapter. serialupdi mode has been supported by **avrdude** since v7. | ||
|
|
||
| You will need the following: | ||
|
|
||
| * A USB serial adapter such as the [FTDI FT232](https://www.amazon.co.uk/dp/B07BBPX8B8) | ||
| * A 4.7 KOhm resistor. A resistor in the range of 3.3K to 10KOhm should be fine if you don't have a 4.7KOhm resistor. | ||
| * 5x female to female jumper (DuPont) wires. | ||
|
|
||
| The +5V and GND headers are wired directly from the serial adapter to the UPDI header. You must create a "Y" jumper cable that connects both the RX and TX pins on your serial adapter to the single UPDI pin on the controller PCB. | ||
|
|
||
| The UPDI pin is the bottom left UPDI header pin that has the square footprint in this schematic screenshot. The resistor needs to be connected to the TX wire of your Y cable. Ensure that your serial adapter voltage selection header is set to 5V. | ||
|
danboid marked this conversation as resolved.
|
||
|
|
||
|  | ||
|
|
||
|  | ||
|
|
||
| You should only need to have the ATtiny and the UPDI header soldered to the PCB to program it. | ||
|
|
||
| Once you have the board connected as shown above, you can program the firmware under Linux using: | ||
|
|
||
| ``` | ||
| avrdude -p t404 -c serialupdi -P /dev/ttyUSB0 -U flash:w:main.hex | ||
| ``` | ||
|
|
||
| Or under Windows: | ||
|
|
||
| ``` | ||
| C 1 | 2 Z | ||
| B 3 | 4 Y | ||
| A 5 | 6 X | ||
| LEFT 7 | 8 GND | ||
| RIGHT 9 | 10 GND | ||
| DOWN 11 | 12 MODE | ||
| UP 13 | 14 START | ||
| avrdude.exe -p t404 -c serialupdi -P COM6 -U flash:w:main.hex | ||
| ``` | ||
|
|
||
| Make sure you set the serial port device correctly by checking **dmesg** output under Linux or **Device Manager** under Windows. | ||
|
|
||
| ## Building a joystick | ||
|
|
||
| The cable is connected to the J2 header using this pinout: | ||
|
|
||
|  | ||
|
|
||
| Pin 1 on J2 and all of the chips is marked on the PCB silkscreen with a small white dot to the side of pin 1. | ||
|
|
||
| Here's photo of this board wired up to a Sanwa clone joystick and housed within a 3D printed [Uzebox fightstick](https://uzebox.org/wiki/Joystick) case: | ||
|
|
||
|  | ||
|
|
||
| ## Credits | ||
|
|
||
| Schematic and ATtiny code by [R.F.Merrill](https://github.com/rfmerrill) | ||
|
|
||
| Silkscreen and documentation by [Dan MacDonald](https://github.com/danboid/) | ||
|
danboid marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #!/bin/bash | ||
| # This is a script to build the 6 button Mega Drive controller PCB firmware. | ||
| # You need avr-gcc version 8 or later and avr-libc installed to build this code. | ||
|
|
||
| # Exit on error, unset variables, catch errors behind a pipe | ||
| set -euo pipefail | ||
|
|
||
| # Move to the directory where the script is located | ||
| cd "$(dirname "$0")" | ||
|
|
||
| # Remove previous build, if it exists. | ||
| rm -f main.elf main.hex | ||
|
|
||
| # Build controller firmware. | ||
| avr-gcc -mmcu=attiny404 -O3 -Wall -Wextra main.c -o main.elf | ||
| avr-objcopy -O ihex -R .eeprom main.elf main.hex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| :1000000019C028C027C026C025C024C023C022C0D4 | ||
| :1000100021C020C020C01EC01DC01CC01BC01AC0F3 | ||
| :1000200019C018C017C016C015C014C013C012C024 | ||
| :1000300011C010C011241FBECFEFCDBFDFE3DEBF64 | ||
| :100040002FE3A0E0BFE301C01D92A130B207E1F7AA | ||
| :1000500015D0C4C0D5CF8F931F9280E0182E80E1B9 | ||
| :1000600080930B0A1092000A81E08093003F109267 | ||
| :1000700020040C980F981F908F91189588ED84BFDD | ||
| :1000800081E08093610080E98093000480911504F1 | ||
| :10009000886080931504F894109220040C980F98AF | ||
| :1000A000109224047894000000000000000000007A | ||
| :1000B0000000000000000000000000000000000040 | ||
| :1000C0000000000000000000000000000000000030 | ||
| :1000D0000000000000008091080485FFFFCF80E150 | ||
| :1000E00040E25EE421E03FE0F894109220040C9896 | ||
| :1000F0000F98109224047894000000000000000083 | ||
| :10010000000000001199FECF000000000000000078 | ||
| :1001100000000000119BFECF1092003F1092000AD9 | ||
| :100120001092200A1092210A8093010A4093280A13 | ||
| :100130005093290A80930A0A2093000A00000000C5 | ||
| :1001400000000000000000001199FECF9091003FD8 | ||
| :100150009111CACF00000000000000000000000064 | ||
| :10016000119BFECF9091003F9111BECF0000000087 | ||
| :1001700000000000000000001199FECFF8940F9AD3 | ||
| :10018000309320040C9A78949091003F9111ACCF59 | ||
| :10019000000000000000000000000000119BFECFE6 | ||
| :1001A000F894109220040F9830932404789490913E | ||
| :1001B000003F911199CF00000000000000000000F6 | ||
| :1001C00000001199FECFF8940F9A309320040C98F8 | ||
| :1001D00078949091003F9115E1F386CFF894FFCF8A | ||
| :00000001FF |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.