]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
pana_m8: Fix unimap
authortmk <hasu@tmk-kbd.com>
Sun, 6 Aug 2017 00:29:36 +0000 (09:29 +0900)
committertmk <hasu@tmk-kbd.com>
Sun, 6 Aug 2017 04:24:37 +0000 (13:24 +0900)
keyboard/pana_m8/README
keyboard/pana_m8/pana_m8.c
keyboard/pana_m8/unimap.c

index c2540b75285952ad0f45e86c231f1e37bfd0cfd0..234da931b27d6fb7c4c034c32977a36d5474b525 100644 (file)
@@ -1,10 +1,13 @@
 Panasonic VP-0187A
 ==================
-It is unknown keyboard from Panasonic
+2017/08/06
 
-6P6C connector
+It is unknown keyboard from Panasonic with Hirose Cherry M8 and 6P6C connector.
 
-Hirose Cheery M8 switches
+Pictures:
+http://imgur.com/a/GAZE7
+
+Hirose Cheery M8 switches:
 https://deskthority.net/wiki/Cherry_M8
 
 
@@ -28,16 +31,25 @@ The keyboard is comprised of some of 4000 series IC without microcontroller.
               |||           |decoder|
               |||           ---------
               |||            |||||| col[0..7]
-              ABC            vvvvvvv   pull down
+              ABC TC4512     vvvvvvv   pull down
             ---------- <----|+++++++|--100K--+
             |data    | <----|+++++++|--100K--+
     STATE<--|selector| <----|+++++++|--100K--+
             | 7 to 1 | <----|+++++++|--100K--+
             ---------- <----|+++++++|--100K--+
-                  row[0..7]                  |
-                             8x8 matrix      -
-                                            GND
+                row[0..7]   | 8x8 matrix     |
+                            |                -
+              TC4078        |               GND
+              ------        |
+    SENSE<----| OR |========+ OR'd row[0..7]
+              ------
 
+- TC4520BP - Dual Binary Up Counter 
+- TC4028B  - BCD-to-Decimal Decoder
+- TC4512BP - 8-Channel Data Selector
+- TC4081BP - Quad 2-Input AND Gate
+- TC4071BP - Quad 2-Input OR Gate
+- TC4078BP - 8-Input NOR/OR Gate
 
 
 Matrix
@@ -60,14 +72,23 @@ Matrix
 1. VCC
 2. Clock     - sends clock to binary counter TC4520
 3. Key State - indicates hi if key selected by counter is active
-4. Sense     - indicates hi if any key is active while Reset is hi.
+4. Sense     - indicates lo if any key is active while Reset is hi.
 5. Reset     - resets counter and drives all column
 6. GND
 
       123456
     ,--------.
-    |        |
+    | |||||| |
     |        |
     `--____--'
        plug
 
+
+Ping configuration
+------------------
+AVR ATmega32u4 is used as protocol converter.
+
+    PD0: Clock. Counter couts up at falling edge.
+    PD1: Key State. Hi if selected key is activated.
+    PD2: Sense. Lo if any key is activated while Reset is Hi.
+    PD3: Reset. Resets counters at riging edge.
index 62fdc748e7c859d19bcb07887dcfe977da3fe75d..19f884877a19a3c1df57ebc7cb6fe88ac158f5b4 100644 (file)
@@ -21,25 +21,26 @@ void matrix_init(void)
     debug_keyboard = true;
     debug_matrix = true;
 
-    // PD0:Clock PD1:State PD2:Sense_All PD3:Reset(Scan_All)
-    DDRD  = (1<<3) | (1<<0);
-    PORTD = (1<<2) | (1<<1);
+    // PD0: Clock. Counter couts up at falling edge.
+    // PD1: Key State. Hi if selected key is activated.
+    // PD2: Sense. Lo if any key is activated while Reset is Hi.
+    // PD3: Reset. Resets counters at riging edge.
+    DDRD  |=   (1<<3) | (1<<0);     // output
+    DDRD  &= ~((1<<2) | (1<<1));    // input
+    PORTD &= ~((1<<3) | (1<<0));    // low
+    PORTD |=   (1<<2) | (1<<1);     // pull-up
 
     dprintf("init\n");
 }
 
 uint8_t matrix_scan(void)
 {
-
-    // Scan_all resets counter
+    // TODO: debouce & unplug detect
+    // Reset counters
     RST_HI();
     wait_us(10);
-    // TODO: cannot get reliable value from SENSE()
-    //uint8_t s = SENSE() | STATE();
-    //if (!SENSE()) return 0; // no activated key
     RST_LO();
     wait_us(10);
-    //if (!s) return 0;
 
     // 8x8 matrix:  row:sense, col:drive, key_on:hi
     for (uint8_t col = 0; col < 8; col++) {
@@ -53,7 +54,7 @@ uint8_t matrix_scan(void)
                 matrix[row] &= ~(1<<col);
             }
             
-            // clock lo - next row
+            // proceed counter - next row
             CLK_LO();
             wait_us(10);
         }
index b185a615219515ef9ee568fdced0b5173a35fa61..78d07b844123c9af54a6cddf9452d0a1a9f236f7 100644 (file)
@@ -21,6 +21,8 @@
 )
 
 #define AC_L1       ACTION_LAYER_MOMENTARY(1)
+#define AC_SPC1     ACTION_LAYER_TAP_KEY(1, KC_SPC)
+#define AC_AENT     ACTION_MODS_TAP_KEY(MOD_LALT, KC_ENT)
 
 #ifdef KEYMAP_SECTION_ENABLE
 const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
@@ -30,10 +32,26 @@ const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = {
     [0] = UMAP(
     ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS, DEL,    F1,
     TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   GRV, LBRC,RBRC,                  F2,
-    LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,         UP,       F3,
+    LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     AENT,        UP,       F3,
     LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,                    LEFT,RGHT,   F4,
-                             SPC                                                DOWN,     HOME
+                             SPC1,                                                DOWN,     HOME
     ),
+    [1] = UMAP(
+    GRV, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, BSLS,     PSCR,PAUS,   F5,
+    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PGDN,UP,  PGUP,TRNS,BSLS,TRNS,TRNS,                  F6,
+    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,HOME,LEFT,DOWN,RGHT,END, TRNS,     LGUI,        PGUP,     F7,
+    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,                    HOME,END,    F8,
+                             TRNS,                                                PGDN,     END
+    ),
+/*
+    [2] = UMAP(
+    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,TRNS,   TRNS,
+    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,                  TRNS,
+    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,        TRNS,     TRNS,
+    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,                    TRNS,TRNS,   TRNS,
+                             TRNS,                                                TRNS,     TRNS 
+    ),
+*/
 };