Author Topic: MODIO Keyboard Scanner  (Read 4051 times)

0 Members and 1 Guest are viewing this topic.

Offline wayne.b

  • Active Member
  • Posts: 7
    • View Profile
MODIO Keyboard Scanner
« on: December 30, 2014, 06:25:07 AM »
I been pulling my hair out all day (and yesterday and the day before and....) , I just cant get an input from a keyboard matrix to work using a ModIO board.
The last thought I had is to Poll the outputs to the matrix using a brain. It harder than I thought. Can anyone point me in the right direction? Keyboard Scanner?

Cheers
Wayne

Offline Peter Homann

  • Active Member
  • Posts: 502
    • View Profile
    • Homann Designs
Re: MODIO Keyboard Scanner
« Reply #1 on: December 30, 2014, 04:21:19 PM »
Hi Wayne,

Have you enabled the keyboard scanner module by clearing bit 5 of Register 106 (CONFIG2)?

Once the keyboard scanner module is enabled, you can read the key presses from register 1158.

Cheers,

Peter
----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com

Offline wayne.b

  • Active Member
  • Posts: 7
    • View Profile
Re: MODIO Keyboard Scanner
« Reply #2 on: December 30, 2014, 05:49:31 PM »
G'day Peter

Many thanks for your quick reply. I'll ask my second stupid question, how do I do this? In the test Modus area, I can read Reg 106, The Hex number was 0025, meaning Bit 7,0 Bit 6,1 Bit 5,0 Bit 4,0 Bit 3,1 Bit 2,0 Bit 1,1... I changed this to 0015, (Bit 6 to low and Bit 5 Hi) restarted everything, still no working. Should the Outputs (0-3) Poll?

Cheers
Wayne  

Offline Peter Homann

  • Active Member
  • Posts: 502
    • View Profile
    • Homann Designs
Re: MODIO Keyboard Scanner
« Reply #3 on: December 30, 2014, 06:33:31 PM »
Hi Wayne,

A couple of things. The address 106 is a decimal address.
Also unless you have been playing around with the config register I would have expected it to be FF hex.

0025 Hex means that you have;
Bit7-0 the DigiSpeed module - on,
Bit6-0 frequency counter module - on
Bit5-1 the  the Keyboard module-  off
Bit4-0 Not used
Bit3-0 High resolution Encoder 2 - off
Bit2-1 High resolution Encoder 1 - on
Bit1-1 Use Encoder 2 - off
Bit0-1 Use Encoder 1 - on


Setting it to 0015 Hex turns on bit 4 and turns off bit 5. Keep in mind that the bits start at bit 0, not bit 1.  The default value for register 106  is FF hex. You should be setting it to BF hex. That will turn of the Keypad scanner.

Also keep in mind that;
1. After changing a config register you need to reset or re-power the ModIO to make the config change take effect.
2. If you have the ModIO address hex switch on position '0' the ModIO uses default config settings and ignores the config register settings.  If you change it to position 6, the ModIO will have an address of 6, the same as the default position, and it will use the settings in the config registers.

The reason that position 0 uses default config values rather than the registers is that if you screw up the communication config registers, you can always put the address switch to position 0 and the ModIO will use a standard configuration so you can communicate with it and fix your screw up :)

Cheers,

Peter
----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com

Offline wayne.b

  • Active Member
  • Posts: 7
    • View Profile
Re: MODIO Keyboard Scanner
« Reply #4 on: January 02, 2015, 06:40:53 AM »
G'day Peter

My mistake, Hi's are On for some and Off for others.
Thanks again.

Cheers
Wayne


Offline Peter Homann

  • Active Member
  • Posts: 502
    • View Profile
    • Homann Designs
Re: MODIO Keyboard Scanner
« Reply #5 on: January 02, 2015, 05:17:36 PM »
The reason for that is that a blank EEPROM is set to 1s. So the config registers have a 1 to represent their default state. So the Keypad  Scanner by default is off. Therefore the bit is called" Keypad Scanner Off"

Clearing the bit will enable the scanner.

Cheers,

Peter
----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com

Offline Peter Homann

  • Active Member
  • Posts: 502
    • View Profile
    • Homann Designs
Re: MODIO Keyboard Scanner
« Reply #6 on: January 04, 2015, 12:27:45 AM »
Hi Wayne,

How did you get on?

Cheers,

Peter
----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com