English | 中文
This project aims to design a high-performance, cool-appearance, and well customized keyboard, which is specially suitable for CS or EE enthusiasts' further development.
Video avaliable here.
total keys | 103(matrix) + 1 Fn |
keyswitches | 3-pin MX |
anti-ghosting | full n-key rollover |
LEDs | 73 monochrome + 31 RGB + lock indicator |
interface protocol | USB + PS/2 |
maximum power | 1.35 Watts |
controller IC | EP4CE6E22C8 |
-
fully programmable: Only use one
Cyclone IV E
family FPGA to control all the peripherals on board. Integrating the software programmability of soft processor with the hardware programmability of FPGA. -
fully open-source: This repository stores the project for FPGA only. PCB and other resources are stored in Baidu Netdisk with different type of keyboard, see home page for details.
-
full n-key rollover: Each switch in matrix connects to a Schottky diode in series, which will realize fundamental full n-key rollover taking advantage of PS/2 protocol.
-
fully-parallel LED driver: 168 channels PWM count independently, connecting to Nios II soft core via Avalon-MM bus.
-
fully-parallel debouncing: All of the debouncers work simultaneously. See also Wiki.
-
fully-parallel interface: The USB and PS/2 interface can connect to different computer at the same time without any interference. Combining compatibility with performance.
Normally, the more encapsulation, the fewer details are visible.(e.g. MATLAB) However, bing in charge of low-level details means less development speed.(e.g. Assembly) This project try to work out a compromise that making application development as rapid as possible based on the most transparent.
This is what is called "hardware/software co-design" in a broad sense. The full stack of embedded system includes PCB, digital logic, C and so on. Whichever the level you are, designers are always in charge.
For example, the LED driver solution. First of all, you should design the scanning mode and select appropriate transistor. Secondly, write RTL code of matrix scanning according to your schematic. And then realize the digital logic of brightness adjuestment and memory map to soft core. Finally, it's embedded software about RGB color transformation algorithms, etc.
As long as you wish, everything is transparent from top to bottom -- straightaway from a C function to the current in transistors.
Although cooperating with hardware and software, mastering every detail is not needed actually.
- If you want to design your own PCB: Draw your PCB based on existing schematics and then burn firmware.
- If you just want to practise soldering: Use PCB documents directly to order PCB prototype. Use BOM to order components. When you finish soldering, burn firmware.
- If you are skilled in mechanics: Purchase an assembled pcba, design your favourite keycap and shell based on existing plate file.
- If you want to use the PS/2 protocol in your own project: Just use these code, documents available as well.
- If you are learning SpinalHDL: Just have a look at the code~
This repo includes four sub-project as below.
Project | Introduction |
---|---|
Quartus | Starting point and destination of the whole project. Low level code written in VerilogHDL. |
SpinalHDL | Use open source high level hardware description language to program toplevel logic. |
Qsys hardware | SOPC designed by Platform Designer. |
Nios software | Applications written in C language, running in Qsys hardware. |
Getting start from wiki. You can transplant some codes into your project. Or follow these steps to use this project for further development.
- Make sure your circuit hardware have no bug.
- Install development environment of SpinalHDL and open the SpinalHDL folder use IDEA.
- Run
GenerateIP
andGenerateTop
in IDEA. - Open Quartus, Platform Designer, generate sopcinfo file.
- Start compilation and download sof.
make
embedded software project to get ELF.- Call Nios Shell,excute command in sequence then get HEX file.
- Convert hex file to
jic
file and burn it.
Watch full video.