Git Product home page Git Product logo

ocreeb-mk-2's Introduction

Ocreeb MK2: Modular Macro Keyboard System

Watch the build video ↓

Ocreeb MK2 is the second iteration of my macropad project. This version features the XIAO RP2040, supports hotswap sockets for the macropad, a detachable switch plate, an OLED screen, and magnetic external modules running the Seesaw firmware.

As I mentioned in the video, there are still major performance issues when using multiple external modules. This is probably due to my implementation of the shared interrupt, and I will look into it. Nevertheless, I will supplement this repo with all the files in case you ever wish to use a part of this.

Build instructions → Instructables

CC BY-NC-SA 4.0

CC BY-NC-SA 4.0

ocreeb-mk-2's People

Contributors

sb-ocr avatar

Stargazers

 avatar Victor P. Araújo avatar 水里灵活的鱼 avatar  avatar SolevelP avatar Stefan Schlott avatar  avatar Nathan Christensen avatar Marc Kronberg avatar Ivan Grunev avatar Osmous avatar  avatar Vlad Goldman avatar stevenK avatar  avatar  avatar  avatar Ben Giles avatar Jake Jarrett avatar Lefuneste83 avatar Dan Voronov avatar Mx. Kassian Rosner Wren avatar  avatar  avatar O.Sakowski avatar Zac avatar Veko avatar Aron Kahrs avatar Vika Vorkin avatar Francesco Dotoli avatar Andrea Cancia avatar Stanislav Petr avatar  avatar  avatar All Unser Miranda avatar  avatar  avatar  avatar Yulin Ding avatar Ben Seeley avatar Josh Gwosdz avatar  avatar nnlychai avatar Drew Seewald avatar Bimmi avatar  avatar  avatar Liponex avatar Flávio Heleno avatar  avatar K0nat4 avatar Oscar Van Slijpe avatar Royce Lee avatar  avatar  avatar Radson Almada avatar Davis avatar Marius A. avatar  avatar Tom Smith avatar  avatar  avatar  avatar Pratyush Khuntia avatar David Konsumer avatar  avatar Rae Kevin Turno Monzon avatar Rsomething avatar Maria Luísa avatar Sergey Muntyanu avatar  avatar Seo, Jang-won avatar Mai avatar Daniel Liu avatar James Rodgers avatar  avatar  avatar  avatar  avatar Uday Kumar Adusumilli avatar pix3l_p33p3r avatar Zero avatar Justin Rudio avatar  avatar  avatar Indra Wahyu avatar  avatar  avatar  avatar Mitch Hutchinson avatar  avatar  avatar Radoš avatar Mustafa ÖZBEK avatar  avatar  avatar  avatar Carlos Sanchez avatar Samayoeru Kaze avatar Alessandro Klein avatar

Watchers

Chris Sader avatar Rodrigo Bariviera avatar  avatar  avatar Nicolas Tremblay avatar Juergen Skrotzky avatar  avatar Le Tuan avatar  avatar Benny Michaels avatar  avatar Ben Seeley avatar Arnoz avatar  avatar  avatar Joel Muscat avatar Mirosław Mówiński avatar Lefuneste83 avatar  avatar  avatar  avatar Sam Warth avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ocreeb-mk-2's Issues

License?

Hey there,

Just noticed your project doesn’t have a license file. Thought I’d mention that adding a license could be really beneficial, especially for a cool project like this. A license helps protect your work from being copied or misused. It also makes it clear how others can use, modify, or distribute your design.

I wasn't stepping on your work. It's truly what I've been looking to play with. I have lots of boards, sensors, but this finally pulls it altogether.

Thanks so much for your work on this!

I'm printing the files as we speak so I can start to tinker!

Usage of TCA4307 on each board and staggered connections

Hi,

First of all, really cool project, thank you for sharing this!

Reading the schematic and the datasheet for the TCA4307 a potential issue arose, the current modules use a single row of pogo connectors for power and communication.
Those connectors aren't staggered and don't ensure a consistent order of connection/disconnection.

I'm trying to come up with a simple solution to quite my worries and wanted to ask if you had issues hot swapping the modules?
Power issues? Communication issues or lockups?

Keycap CAD files

Hey! Noticed that the keycap STL is linked and listed in the instructables article, however it is nowhere to be found within the repo

CAD files

Hi. Can you please update CAD/STL sections with .step files? i would like to make a my own macropads and modules based on your design

decode module nr in pulse count fast

hi this is so cool of you @sb-ocr! ok disclaimer im writing this in my brake rn I will revise this later the example likely is faulty currently

tldr.

perhaps this helps to decode the module nr. in the interrupt pulses fast enough.

import board
import array
import adafruit_pioasm
import rp2pio

count prof = adafruit_pioasm.assemble( """
.program counter

mov ~y y          ; initial prep for addpulse

reset:            ; this block initiates grace time and waits till pin is low
set x 11111           ; set retry counter or grace period max 5bit
wait 0 pin 0          ; wait till pin is low

findedge:         ; this tries to find pulse or exits
jmp pin addpulse      ; when pin high add one to pulse count
jmp x— exit           ; else exit when grace period is zero 
jmp findedge          ; else retry

addpulse:         ; this adds one to pulse counter
jmp y—                ; adds one since y is inversed in exit
jmp reset             ; reset grace period and test for next pulse

exit:             ; this writes pulse count to isr
jmp y! reset          ; when y zero alias no pulses detected reset
mov ~y y              ; inverses y/pulse count so isr is filled with real count
mov isr y             ; depletes y to zero and fills isr
mov ~y y              ; inverses y to prep it for addpulse
push noblock          ; push isr and do not wait for empty tx fifo
"""

countpio = rp2pio.StateMachine(
    program    = countprog,
    frequency  = 0,  # 125MHz pio clock speed
    jmp_pin    = board.A0,  # interrupt line pin 
)

pulsecount = array.array( 'L', [32] )

while True:
    while countpio.in_waiting() < 1:  # wait until at least one count is available
        pass
    while countpio.in_waiting() > 0:  # read all words in fifo
        countpio.readinto(pulsecount)  # read from rx fifo
        print(pulsecount[0])
    countpio.clear_rxfifo()  # reset rx fifo to make room for new counts 
   

limits since one instruction takes 8ns at 125MHz

11111bin/32dec *8ns = 256ns is the grace period until pulse count is reset
2 *8ns = 16ns is the minimum high time for one pulse
i dont know the minimum low time of a pulse but perhaps 8ns duno
assumes a default low state of the interrupt line
tx fifo contains up to 4 pulse counts then counts are lost
dwell time for one pulse count until the next is 7 *8ns = 56ns

more info

this is circuit python. with rp2pio and adafruit_pioasm libraries from adafruit you can init a pio of the rp2040 to count pulses until no pulse is detected for 256ns (but this is adjustable). After one count the pio needs 56ns then it’s ready to count again (perhaps this can be helped by using two pios). So no simultaneous inputs are possible like this. I think. anyways feel free to close this at anytime this is just a thought

or perhaps encode the module nr. in pulse width

this is to read pulse length you need rp2pio and adafruit_pioasm libraries. source of the pio code

import board
import adafruit_pioasm
import rp2pio

pwminprog = adafruit_pioasm.assemble( """
.program PwmIn

; algorithm:

; loop:
;    reset the 'timer'
;    loop: 
;       decrement timer
;       test for falling edge 
;    record timer value as pulse width (actually, (0xFFFFFFFF - x)*2/125MHz is the pulse width)
;    loop:
;       test for rising edge
;       decrement timer
;    record the timer value as period (actually, (0xFFFFFFFF - x)*2/125MHz is the period)

 
.wrap_target
    mov x ~NULL         ; start with the value 0xFFFFFFFF

timer:
    jmp x-- test        ; count down
    jmp timerstop       ; timer has reached 0, stop count down
test:
    jmp pin timer       ; test if the pin is still 1, if so, continue counting down
timerstop:              ; pulse is over (or timer has reached 0)
    mov ISR x           ; move the value in x to the ISR: the pulsewidth (0xFFFFFFFF-pulsewidth)
    push noblock        ; push the ISR into the RX FIFO

timer2:
    jmp pin timerstop2  ; if the pin has become 1, the period is over, stop count down
    jmp x-- timer2      ; if not: count down
timerstop2:
    mov ISR x           ; move the value in x to the ISR: the period (0xFFFFFFFF-period)
    push noblock        ; push the ISR into the RX FIFO

.wrap
"""


pwminpio = rp2pio.StateMachine(
    program          = pwminprog,
    frequency       = 0,
    jmp_pin           = board.A0,
    in_shift_right  = False,
)

lowtime = array.array( 'L', [32] )
hightime = array.array( 'L', [32] )

while True:
    pwminpio.clear_rxfifo()
    while pwminpio.in_waiting() < 2:
        pass
    pwminpio.readinto(hightime)
    print(hightime[0])
    pwminpio.readinto(lowtime)
    print(hightime[0])

even more info

im not too good at programming and quite new to this in general. anyways
I saw your video and your issue with missing inputs due to pulling inefficiencies. you proposed to encode the module nr. in the interrupt pulses. I recently tried to read a pwm signal of a phillips hue lamp and had the same issue with circuit python being to slow. I solved the issue by reading the signal via a pio of the rp2040. hope this is relevant to you since it is all circuit python it shloud be possible to integrate without a rewrite in c or so

Core and modules schematic files

Hey! Can I ask you to attach schematic files of the boards for the Core and Modules, as was the case for the first version of the macropad?

Cannot get main macropad module to type

Hey! I have currently finished building the main macro-pad module. I have put the firmware code on the board, and I have checked my soldering a few times now. I cannot get the RGB to light up (The OLED works fine), and the board is constantly inputting strokes into my computer. I am not sure what is causing the issue. Here is my testing keymap in main.py:

keyboard.keymap = [ [ KC.A, KC.B, KC.C, KC.D, KC.E, KC.F, KC.G, KC.H, KC.I, KC.J, KC.K, KC.L, ] # Layer 1 ]

Here is my output in a random text editor when this is saved to the board: (Note I am trying to push buttons, hold buttons etc, to try and get this to stop, which is where the new/random other letters start appearing)

ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddiddjdklefdghlghbeaddlfcdgaddjkldefghdadibcddgaddjklefgdhadibdcdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddgaijklefghadddddddddddddddlbcjijklefghaddddddddddlbcjijklefghaddddddddddddddddddddddddlbcgaklefghaijjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjbcdiijklefghaddddddddddddddlbcjijklefghadlbcgaijklefghadddddddddddddddddddddddddddddlbcgaijklefghadlbcgaklefghaijjjjjjjjjjjjjjjjjjjjjjjjjjjabcdgjklefghaiabgijklefghadddddddddddddddddddddddddddddddlbcjijklefghaddddddddddddddddddddddddddddddddddlj

And here is my soldering work:

IMG_0585

I'm not sure if you have encountered this issue, however I would like to resolve this issue. If you need any more files, code snippets, or log files let me know.

-Demon

Nice Work!

@sb-ocr You wouldn't believe it, I did a school Design & Tech major works on this concept a few years back, you've implemented pretty much everything I ideated right down to the custom pogo pin connectors, only I did a base mounting board design. Sharing some of my old files here as they might be of interest! Obviously it's not super technical as it had to fit within particular marking guidelines and cover particular topics, but I'm sure you'll enjoy the blender render promo video that looks remarkably like the one in your youtube vid! If you ever decide to do a version 3, I'd love to have a chat, I've got other projects on at the moment but still would love to make this a reality for the live production / DJ space! Love your work!

MIDIFIER Design Folio.pdf

MIDIfier.1000.Hook.mp4

Project Status

Just a quick question on the status of the irq handling issue. As suggested, I am holding off a build.

incompatible .mpy file / no pull up found on SDA or SCL; check your wiring

Hi,
First of all, great job with this project :D i really want to finish the build and use it.

I've solder the components on boad and uploaded the firmware.
When it starts up i get this error.
image

I've commented the ocreebModule import line and the lines where its used just to check if i can get anything running, but after i did that i've got this error :(
image

I've put the code on an empty XIAO RP2040 and i got the same error.
Im new in this hobby and i dont know if i need anything connected to that pinouts to run the code or not.

Here is my board.

WhatsApp Image 2024-04-15 at 14 17 05_2f278895
WhatsApp Image 2024-04-15 at 14 17 05_9c3a4fcd
WhatsApp Image 2024-04-15 at 14 17 05_12d9860a
WhatsApp Image 2024-04-15 at 14 17 05_c0d6b2b6
WhatsApp Image 2024-04-15 at 14 17 05_fb9d282b
WhatsApp Image 2024-04-15 at 14 17 06_e114c320

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.