3228

Nine-key custom keyboard

 
Overview

Features

picture

QQ picture 20210324095831.jpgQQ picture 20210324095840.jpg

feature

  1. Nine-key hot-swappable RGB keyboard
  2. Knob control
  3. Any button can be customized with macro function
  4. RGB lights can achieve special effects of breathing lights and rainbow lights
  5. The keyboard can be defined in three layers with different keys. Each key can hold up to 93 keys.
  6. Independent storage, no loss when power is off
  7. Host computer control
  8. Multimedia button control
  9. Host computer and microcontroller are open source
  10. Infrared remote control

Implementation ideas

stm32 uses HID to connect to the computer, and has two endpoints, one for communication with the host computer and one for the keyboard. Adopt the matrix keyboard scanning idea and add diodes for full-key rollover. The download port and serial port are lead out separately and can be used for debugging. The ws2812 lamp is controlled by spi and dma. Use at20c64 as storage. It refers to the source code of many big guys, so the code may be a bit messy.

pit

Pit 1

Because the price of stm32f103c8t6 has increased significantly, I started to buy domestic HK, but in the end I found that the USB could not be used.

Pit 2

The welding level in the early stage was too low, so I bought c8t6 and the welding failed. Finally, I bought stm32febkc6t6, which is a special chip for electric vehicles, but it is actually pin to pin compatible and completely replaces f103c6t6. It is super cheap, but the memory and storage are too small, only 10/ 32kb, which is a bit smaller than the 20/64 of c8, and the spi2 port used by ws2812 at the beginning of the design. C6 does not have spi2..., rgb cannot be realized, and the idea of ​​using pwm was not realized in the end.

Pit 3

I don’t know why I selected 10k for the sda ​​and scl pull-ups. Every time I connected the monitor, the at20c64 failed. After troubleshooting for a long time, I finally broke the oled12832. Therefore, it actually shows that there is still something wrong with the upper computer, and the lower computer has not been debugged. , first use it as no screen

Pit 4

Cubemx will reset the USB every time it is configured. It is recommended to save the Middlewares and USB_DEVICE folders before generating code for each configuration, and replace the files after the code generation is completed.

What needs to be corrected

Because I was poor (lazy), I corrected some errors in the circuit diagram. I changed the ws2812 control spi2 to spi1 and reserved the pwm control. Therefore, the actual code needs to be fine-tuned. If you use c6t6, you can use the branch newf103c6. If you use c8t6, ​​use the branch newf103c8. It needs to be modified. The places are as follows 1. Snipaste_2021-03-24_09-42-38.png The original knobs used pa5 and pa6, and the new ones use pa10 and pa11. It is necessary to reset pa11 as interrupt trigger and pa10 input. Both are drop-down programs. Change as follows. Replace pa5 and pa6 in main.h.

void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { if (GPIO_Pin == GPIO_PIN_6) { //ec11 knob data delay_us(100); //printf("145 "); if (HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_6) == 1) { if (HAL_GPIO_ReadPin (GPIOA, GPIO_PIN_5) == 1) { //clockwise//delay_ms(10); knobkey_send(0); } else { //counterclockwise knobkey send(1); } } _HAL_GPIO_EXTI_CLEAR_IT(GPIO_PIN_6); } }

2. Configure spi2 to spi1. The configuration parameters are the same. Turn on dma and the speed is 2.25m. Change hspi2 in ws2812.c to hspi1. There are two places. 3. Turn on the screen

Delete the second return of void Info_Deal_Display(void) in infoDeal.c

other

The main maintenance is still on the c8t6 version, and the bugs are also mainly fixed on c8t6. After all, the space is larger, c6t6 can be used, and can realize basic keyboard functions. The light has not been verified because there is no spi2. Although it was changed to spi1 later, it has not been boarded yet.

Host computer

Using C# programming, administrator rights are used to obtain the cpu temperature, net4.5, after all, for the sake of functionality, it is actually quite ugly. Snipaste_2021-03-24_09-54-56.pngSnipaste_2021-03-24_09-55-07.png

Open source

The code is open source on the host computer on the code cloud: https://gitee.com/wanglifree/customized_keyboard_csharp.git Microcontroller: https://gitee.com/wanglifree/stm32_customized_keyboard.git  Please check the branch 3D printing shell: https://gitee. com/wanglifree/customized_keyboard_3dmode.git  edited by sw2016, the stl has been exported and can be printed directly

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-07 23:19:15

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号