Matrix Keypad routine


Closed Thread
Results 1 to 40 of 135

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default

    Another transistor or other driver I suppose.

    Microchip has such Mosfet drivers (either for high or los side)

    Ioannis

  2. #2
    Join Date
    May 2007
    Posts
    66


    Did you find this post helpful? Yes | No

    Default

    Ioannis / Steve

    I would like to drive a 220V circuit with a power mosfet.
    Do you think an optocoupler is a MUST or will I be able to get away with a diode to protect my pic?
    If so, what diode or alternative protection would you recommend?
    Last edited by passion1; - 22nd June 2007 at 15:14.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    it's up to you. Everything will depend of what the whole beast will do, and how the enclosure design is done. But to me, as long as there's room to fit a transformer and optocoupler and keep away the AC line away of the user... i feel better and sleep all night without any problem.

    What do you need to drive?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    ...

    But to me, as long as there's room to fit a transformer and optocoupler and keep away the AC line away of the user... i feel better and sleep all night without any problem.

    I double that. Even if the end user is well isolated from the circuit, YOU are not trying to make it work. You will have to debug the circuit while alive and sure put your life in danger.

    How many pcs are you going to sell? If it is say low quantity, for sure you will be paid by your time to develop the system. That money should be more than enough to let you put that transformer without second thought.

    In my country people say that coward's mother will never cry over the grave! Of course it sounds more elegant in greek than the awkard translation!!!

    Ioannis

  5. #5
    Join Date
    May 2007
    Posts
    66


    Did you find this post helpful? Yes | No

    Default

    Ioannis / Steve

    Thank you for the wise advice!! I agree 100%.

  6. #6
    Join Date
    Apr 2007
    Posts
    24


    Did you find this post helpful? Yes | No

    Default Is it not just? AND am I missing somthing?

    Hello all,

    I have to ask because I have NEVER seen it done any other way. But is it not just plain good design practice to current limit with series resistors and pull up or down ALL digital I/O's?

    And as far as driving your 220AC device. You should ALWAYS use some sort of isolation device to protect your DC circuits AND the poor person that is trying to use them!

    But back to the thread....

    Tell me if I am missing something here and if this would work at all:

    if doing a keypad scan could you not use portb 0-2 and portb 3-7 for a 3x4 keypad. then use a look up table to get the actual key pressed? If you could do this it would be easy to add "secret" key combinations to do special functions in the project.

    I am just getting started here and learning lots by reading. I have spent quite some time looking over the Keypad code posted here and its VERY complex more so then I would have thought. am I missing something here?
    (I am not saying anything bad about the code. I could just be ignorant to what it takes to actually do this. So please don't be insulted.)

    Also, I see no accomidation in the keypad for compairing the input from the keypad to stored values for say "pin access" or the such. Or is this code ment to be only the keyscan?

    Just asking?

    ;Smart A** Programing Joke starts here
    cls
    Print "Best Regards,"
    Print "Bill12780"
    end

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi Bill,

    It's not that it really takes that much code to scan a keypad. You can write your own that's much simpler, (Except that YOU actually have to write it). And then it will probably only work with that one set of hardware that you wrote it for.

    But mister_e's keypad module was written to work with Everybody's program. With lots of options to allow the user to customize it to work with whatever hardware they are using, and with different modes such as Auto Repeat, and Scan Once, or Modal modes. Without the user having to do much at all.

    It looks complicated on the inside, but that's the part you don't need to worry about. All you have to deal with is the actual useage of the module. Which is really easy. Define your pins and desired features, use an @ READKEYPAD _KeyVar, and you're done.

    It's just like when you use PicBasic Pro itself. You don't care how the code works inside the compiler. You just want to say LCDOUT "Hello World" and have it show up on the LCD display.
    Also, I see no accomidation in the keypad for compairing the input from the keypad to stored values for say "pin access" or the such. Or is this code ment to be only the keyscan?
    Correct. Just reads the keypad.
    For some sample code that can recognize a sequence of key presses. This might help.

    Combinaton Gate access
    http://www.picbasic.co.uk/forum/showthread.php?t=5695
    DT

  8. #8
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by bill12780 View Post
    I have to ask because I have NEVER seen it done any other way. But is it not just plain good design practice to current limit with series resistors and pull up or down ALL digital I/O's?
    This is what I was taught back in the "old days", but there are lots of circumstantial exceptions--there were circumstantial exceptions, then, too, but probably not as many of them!
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

Similar Threads

  1. calculator-like code entry with matrix keypad and display
    By Dennis in forum mel PIC BASIC Pro
    Replies: 35
    Last Post: - 16th December 2009, 22:58
  2. Need help in matrix keypad coding
    By rano_zen06 in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 24th May 2008, 13:16
  3. I2C PCF8574 4X4 Keypad routine
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th January 2007, 21:25
  4. Inconsistent output on a 4x4 matrix keypad
    By markcadcam in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 24th November 2006, 03:54
  5. very basic matrix keypad question
    By kitcat in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th July 2006, 21:33

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts