Shop OBEX P1 Docs P2 Docs Learn Events
Almost free keyboard for portable prop? - Page 4 — Parallax Forums

Almost free keyboard for portable prop?

124»

Comments

  • BeanBean Posts: 8,129
    edited 2008-07-16 14:33
    Here is a little document I made up for the TKB150P, and some SX/B code.
    To see the SX/B code work do: DEBUG, then press the POLL button.

    Bean.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    "A government big enough to give you everything you want, is big enough to take away everything you·have."·· Thomas Jefferson

    "It is our choices, Harry, that show what we truly are, far more than our abilities."·Dumbledore from Harry Potter

    www.iElectronicDesigns.com
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2008-07-16 15:41
    This information and program will be a great start!

    Thank you so much.
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2008-07-19 00:03
    We both have our Keyboards now. I have 1 of mine wired up and working using·Bean's KB1000.sxb DEBUG program.

    However, the comments say don't use an internal oscillator because the serial is not stable with an internal oscillator. However, it worked with no resonator installed. But I have always been told not to use DEBUG with an external resonator because it could blow up the SX-Key which I believe happened to me once.

    So I take it that I can change the DATA statements in the program to add in the other Keys like numbers (capitol letters too?) and symbols?

    Thanks again!
  • BeanBean Posts: 8,129
    edited 2008-07-19 01:04
    Tim,
    · Glad you got it working !

    · When using DEBUG the SX generates the clock. And it is very stable. So that is why it works.


    · To get the digits and stuff, you need to set flags when certain keys are pressed (like FN), they use a different data table if they are active.
    · When I get a chance I'll work on a better demo program that does that.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    "A government big enough to give you everything you want, is big enough to take away everything you·have."·· Thomas Jefferson

    "It is our choices, Harry, that show what we truly are, far more than our abilities."·Dumbledore from Harry Potter

    www.iElectronicDesigns.com

    ·
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2008-07-19 01:20
    Ah - The oscillator clock in the SX Key (forgot about that)! Makes sense now.

    I was thinking that Lookup tables could be used for this.

    I appreciate you expanding on the demo.

    Thanks again!
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2008-07-20 19:23
    All,

    I have modified Bean's KB1000.sxb program (see attached) to also see the BLUE keys. This is working as I would expect. It checks for $01 (FN key) and displays on the Debug window the correct keyCodes.

    However, if 'Q' is equal to $10, why does Debug display is as 51 (which is the ascii code for Q)? Can anyone explain this? I see no where's on the screen where $10 is listed nor the other Release keys. I thought that I should modify the SERIN statement to look·something like this: SERIN KeyboardPin, N9600, keyCode,·release1, release2 but·it does not ·do anything in Debug nor outside of Debug.

    I have spent over a day just trying to have it recognize a key being pushed (outside of Debug) and I can't get anything to work. What I wanted to do is press a certain key and have it break out of the DO LOOP routine and turn on a LED or something to some way let me know it is no longer scanning for keys.

    Bottom line - works fine in Debug but not running outside of Debug. Can anyone help with this?

    Thanks
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2008-07-21 02:00
    I modified the program again to connect·8 resistor/leds to RC and moved the keypad pin to RB.7.

    When I leave the program as is and run in Debug mode (click on "Poll" too), I see the 8 LEDs display correctly and the Watch keyCode is correct (e.g. press the Q button displays Watch keyCode = 81 and the LEDs display 0*0*000* -> 64+16+1 = 81). So everything is fine under Debug using Poll or even Run.

    However when I comment out the Watch and Break statements and compile normally, no LEDs turn on. I am really stumped on this. I tried using some PAUSEs and other ideas but don't understand what is happening here.

    ' Test program for Micro Innovation TKB150P mini keyboard
    DEVICE SX52, OSCXT1 ', TURBO, OPTIONX, STACKX
    FREQ 4_000_000
    ' DO NOT USE INTERNAL OSCILLATOR, IT IS NOT STABLE ENOUGH FOR SERIAL
    ' On keyboard connect: VDD to supply; GND to ground; PE3 to RA.0
    ' Keyboard seem to work at 5.0V, but 3.3V is recommended.
     
    'KeyboardPin   PIN RC.2 INPUT
    KeyboardPin   PIN RB.7 INPUT
     
    LED  PIN RC OUTPUT
     
    keyCode       VAR BYTE
     
    PROGRAM Start
    Start:
      DO
        SERIN KeyboardPin, N9600, keyCode
        IF keyCode < $70 THEN
          IF keyCode = $01 THEN
            DO
              SERIN KeyboardPin, N9600, keyCode
              READ Blue + keyCode, keyCode
            LOOP UNTIL keyCode <> 0
          ELSE
            DO
              READ Keys + keyCode, keyCode
            LOOP UNTIL keyCode <> 0
          ENDIF
            'WATCH keyCode,1,FSTR
            [b][color=red]WATCH keyCode,8,SDEC
           BREAK
    [/color][/b]        'keyCode = keyCode ' Need an instruction for break to work
            [b]LED = keyCode[/b]
        ENDIF
      LOOP  
    END
    
    Keys:
      DATA 0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ' $00 to $0F
      DATA "Q","W","E","R","J","K","L",0  ,0  ," ",0  ,0  ,0  ,0  ,0  ,0  ' $10 to $1F 
      DATA 0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,"D","F","G","H",0  ,0  ,0  ,0  ' $20 to $2F
      DATA 0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ' $30 to $3F
      DATA 0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,"M","N","B","S","A","P","O"' $40 to $4F
      DATA 0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ' $50 to $5F
      DATA 0  ,0  ,0  ,0  ,"V","C","X","Z","I","U","Y","T",0  ,0  ,0  ,0  ' $60 to $6F
    Blue:
      DATA 0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ' $00 to $0F
      DATA "1","2","3","4","'",0 ,"@",0  ,0  ," ",0  ,0  ,0  ,0  ,0  ,0   ' $10 to $1F 
      DATA 0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,"+","-","=",":",0  ,0  ,0  ,0  ' $20 to $2F
      DATA 0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ' $30 to $3F
      DATA 0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,".","'","!","/","*","0","9"' $40 to $4F
      DATA 0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ' $50 to $5F
      DATA 0  ,0  ,0  ,0  ,"?",")","(","$","8","7","6","5",0  ,0  ,0  ,0  ' $60 to $6F
    
    
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2008-07-21 22:22
    Well - I figured it out. I needed to put back in a resonator (and change the FREQ statement to the resonators value) and then I could run the program outside of Debug. However, the value of Q was 81 (or $51) and could exit out of the loop if pressed. I still don't see where the value of $10 comes from for Q. But at this point, I am happy I can continue with my progress.

    ' Use TKB150P Micro Datapad
    ' Vcc tied to +5vdc (actually runs on 3.3vdc - but 5vdc works)
    ' Gnd tied to ground
    ' PE3 serial tied to RC.2 (or any other available key)
     
    Datapadpin PIN   RC.2 INPUT  'PE3 serial wire from TKB150P
     
    keyCode    VAR Byte
    alpha      VAR Byte
     
    m_lin1     VAR Byte (8)
     
    Datapad    FUNC  1, 0  ' Scan the Datapad
     
     
    ' Store 8 characters into m_line1
     
    FOR alpha = 0 TO 7
      Datapad
      m_lin1(alpha) = keyCode
    NEXT
     
     
    END
     
     
    FUNC Datapad
    DO
      SERIN Datapadpin, N9600, keyCode
      IF keyCode < $70 THEN
        IF keyCode = $01 THEN
          DO
            SERIN Datapadpin, N9600, keyCode
            READ Blue + keyCode, keyCode
          LOOP UNTIL keyCode <> 0
        ELSE
          DO
            READ Keys + keyCode, keyCode
          LOOP UNTIL keyCode <> 0
        ENDIF
        RETURN keyCode
        IF keyCode THEN EXIT  
      ENDIF
    LOOP  
    ENDFUNC
     
     
    Keys:
      DATA 0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ' $00 to $0F
      DATA "Q","W","E","R","J","K","L",0  ,0  ," ",0  ,0  ,0  ,0  ,0  ,0  ' $10 to $1F 
      DATA 0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,"D","F","G","H",13  ,0  ,0  ,0 ' $20 to $2F
      DATA 0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ' $30 to $3F
      DATA 0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,"M","N","B","S","A","P","O"' $40 to $4F
      DATA 0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ' $50 to $5F
      DATA 0  ,0  ,0  ,0  ,"V","C","X","Z","I","U","Y","T",0  ,0  ,0  ,0  ' $60 to $6F
     
    Blue:
      DATA 0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ' $00 to $0F
      DATA "1","2","3","4","'",0 ,"@",0  ,0  ," ",0  ,0  ,0  ,0  ,0  ,0   ' $10 to $1F 
      DATA 0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,"+","-","=",":",0  ,0  ,0  ,0  ' $20 to $2F
      DATA 0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ' $30 to $3F
      DATA 0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,".","'","!","/","*","0","9"' $40 to $4F
      DATA 0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ,0  ' $50 to $5F
      DATA 0  ,0  ,0  ,0  ,"?",")","(","$","8","7","6","5",0  ,0  ,0  ,0  ' $60 to $6F
    

    Post Edited (T&E Engineer) : 7/22/2008 12:25:58 AM GMT
  • lookinglooking Posts: 4
    edited 2009-08-06 07:50
    Hello,

    I just want to ask if someone has any of these "Micro DataPad Mini Keyboard for Palm PDA m100/m105 Series" left, mentioned here:
    http://forums.parallax.com/showthread.php?p=702548

    Does anybody like to sell 2 or 3 pieces?
    I live in Germany, how much would it cost including shipping costs?
    Please contact me via PM.
    Thank you.

    Greetings
    Michael
  • HShankoHShanko Posts: 402
    edited 2011-02-25 12:05
    Hi anyone, Did an object ever get written for this wee keypad? I found a nice documentation by a Mike Cook but it is not printable without registering which I didn't want to do.

    Has anyone really made use of the keypad? The encoding seems awkward at first glance; may have been a reason for it.

    I got my 6 units, opened one up to study the design and pcb layout, and powered it to scope the output. Other work pushed it aside. Wonder how these worked with the Palm?
  • BeanBean Posts: 8,129
    edited 2011-02-25 12:26
    I have used them.
    Here is the info that I have about them.

    Bean
  • HShankoHShanko Posts: 402
    edited 2011-02-25 12:38
    Thank you Bean. I did see the thread on these and someone even measured the current draw, I note. Neat and small; if only my fingers fit better; easy to hit two or more 'buttons'. Thanks again.
  • HShankoHShanko Posts: 402
    edited 2011-03-01 13:17
    Hi All,

    Finally got around to the M105 Mini-keypad. The keypads were available for 'free' almost, but was too occupied at the time to get to this state of progress. Anyway thought I'd document it.

    Used John Abisher's early code to get the Prop and keypad working, completed the lookdown/lookup lines, and modified the tv display to my liking. Used wire-wrap wire to connect keypad and Prop Protoboard, as was out of stranded wire; temporary setup for this effort. Below is the code, but attached also is the archive and photos. Another learning curve project., I'd already had a female header on the board for SD card, so used that to plug in a male header wired to the keypad.

    Works well, but the blue marking on the keypads is nearly useless for these old eyes. Keys are so close that fingers too easily hit adjacent keys. At $0.39 (shipping was lots more) a nice package; if only the i/f connector was a 'normal' type.
    ' from Prop forum, by Johm Abishier
    ' by H Shanko rev. 9:30 am 28 Feb.2011
    
    CON
      Rxpin = 0
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
      #0, lc, fn, caps
    OBJ
      tv    : "TV_Text"
      sio   : "FullDuplexSerial"
      vp    : "Conduit"                  ' transfers data to/from PC, 1 cog
      qs    : "QuickSample"              ' captures INA, variables, 1 cog @20 MHz
    VAR
      long stack[200], frame[400], char, junk1, junk2, state, idx, outchar
    PUB Main 
      vp.register(qs.sampleINA(@frame,1)) 'sample INA w/ 1 cog up to 20 MHz (MUST BE COG 0)
      optional_configure_viewport   ' optionally configure Viewport's interface
      vp.share(@char,@outchar) 'share memory from 'key' to 'id';   END of VP commands <<===  
       
      tv.start(12)
      sio.start(Rxpin,-1,1,9600)
      state := lc
      tv.str(string("  M105 Keypad/Prop I xlator - 1 Mar.2011",13))
      repeat
    '    tv.out($00)                 ' clear screen ???
        tv.str(string("Type a char",13))
    '    ReadChars
        case state
          lc:
            ReadChars
            if char == $1        ' if 'lc' and 'Fn', 'upper case' (=blue keycap symbols)
              state := fn
            else
              idx := lookdown(char: $10,$11,$12,$13,$6B,$6A,$69,$68,$4F,$4E,$4D,$4C,$28,$29,$2A,$2B,$14,$15,$16,$17,{
              }$01,$67,$66,$65,$64,$4B,$4A,$49,$48,$2C,$2D,$2F,$2E,$18,$19,$19,$1A,$1B,$62,$63)
              outchar := lookup(idx: "qwertyuiopasdfghjklBFzxcvbnmDELDRP  TDMU")
          fn:
            ReadChars
            if char == $19     ' if 'Fn' and 'Space' key, caps (upper-case) mode
              state := caps
            elseif char ==$01 ' if 'Fn' and 'uppercase', 'lc'
              state := lc
            else
              idx := lookdown(char: $10,$11,$12,$13,$6B,$6A,$69,$68,$4F,$4E,$4D,$4C,$28,$29,$2A,$2B,$14,$15,$16,$17,{
              }$01,$67,$66,$65,$64,$4B,$4A,$49,$48,$2C,$2D,$2F,$2E,$18,$19,$19,$1A,$1B,$62,$63)
              outchar := lookup(idx: "1234567890*/+-=:'",$22,"@BF$()?!,.DELDRP  TDMU")
          caps:
            ReadChars
            if char == $1        ' if 'caps' and 'Fn', 'lc'
              state := lc
            else
              idx := lookdown(char: $10,$11,$12,$13,$6B,$6A,$69,$68,$4F,$4E,$4D,$4C,$28,$29,$2A,$2B,$14,$15,$16,$17,{
              }$01,$67,$66,$65,$64,$4B,$4A,$49,$48,$2C,$2D,$2F,$2E,$18,$19,$19,$1A,$1B,$62,$63)
              outchar := lookup(idx: "QWERTYUIOPASDFGHJKLBFZXCVBNMDELDRP  TDMU") 
        tv.str(string(", the character is: "))
        tv.out(outchar) 
        tv.str(string(" = hex "))
        tv.hex(outchar,2)
        tv.out(13)
    '    waitcnt(CLKFREQ + cnt)
        
    PRI  ReadChars
      char := sio.rx 
      junk1 := sio.rx
      junk2 := sio.rx
      tv.hex(char,2)
      tv.out(32)
      tv.hex(junk1,2)
      tv.out(32)
      tv.hex(junk2,2)
    '  tv.out(13)                            
      return
    '+-------------------------------------------------------------------------------------+
    PUB optional_configure_viewport                                                                                                
      vp.config(string("var:io(bits=[all[0..29],30tx,31rx])"))
      vp.config(string("var:io,key,id")) ' show these VARs
      vp.config(string("lsa:view=io,timescale=200ns,trigger=io[8]f")) ' trig on A8 falling
      vp.config(string("edit:key(default=5,mode=text)"))
      vp.config(string("start:lsa"))                 
    '+-------------------------------------------------------------------------------------+
    
  • HShankoHShanko Posts: 402
    edited 2011-03-01 13:53
    Is anyone using the M105 keypad?

    If not, why not?
  • blittledblittled Posts: 681
    edited 2011-03-02 09:12
    I use the M105 keypad with Rayman's Propeller System Module to make a "Portable Computer" The code as it stands waits for a keypress so I modified it so it times out after 10 milliseconnds so I can monitor if a keypress has happened or not and if so act on it.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-03-02 09:25
    I still have a few of these on my shelf.. They are awesome little keyboards. The only reason I don't use them more often is because I have big gorilla-like hands. :)

    OBC
  • HShankoHShanko Posts: 402
    edited 2011-03-02 10:47
    @ OBC, I'd guess even 'normal' hand/finger size finds the M105 keys too close. My iMac keys are 3/4", a rather normal keyboard spacing. The M105 is about 0.35", just under half that. Not one for speed typing.

    @ blitted, I'd like to see a photo of how your keypad is cabled in use. Would your source code be available to study? I like your idea, even though my above statement still holds; More for one finger typing than two or more fingers in use. I have both a 3.5" and several 4.3" LCDs from Rayman. Make quite nice displays.
Sign In or Register to comment.