- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not much Text in the post above, Forum Software kicked me out, so let me start over.
I decided to write my first component. Mostly because Eugene came up with a self-written component which refered to a program I had written before and I was not quite content with his implementation and favoured mine (of course!!!)
I would like to make a KeyPad (matrix keyboard) component which (as a component should be) is adaptable to different keypad-sizes and organization. So keypads from 2x2 (4 keys) up to 8x8 (64 keys) should be supported.
The keypad is connected directly to the required number of input-pins and with the help of a timer and an interrupt the key-presses are debounced, put into a buffer, repeated for long keypresses and can be retrieved from the buffer by some API-calls.
I will get you informed of every step I perform to get this component working and I would be glad about any comments, suggestions or hints from the community.
So, to start with a component, we will have to define at first its capabilities expressed in the parameters the user may change to fit the needs of his usage. To get a look at the way the software is going to work, look here http://www.cypress.com/?app=forum&id=2233&rID=56644
Parameters:
Columns (2..8)
Rows(2..8) The keypad matrix organization
Scan Rate (5-100ms)
Number of equal key readings before a key is accepted (1..99)
Initial wait before a keys are repeated (250..1000ms)
Repetition wait time (100..1000ms)
Keyboard buffer size (2..20)
APIs
KeyPad_Start()
KeyPad_IsKeyReady()
KeyPad_GetKey()
I do not know at this state of the design if I should have a hardware-signal for "Key pressed" or "Key Buffer not empty", so I'll suspend that for "changing a component" which will come later.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May I know what is the purpose of the keyboard buffer?
Keyboard buffer size (2..20)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How about
1. A function to return the current state of de-bounced matrix,
2. A function "interruptOnKeyPressed(keyNumber)" which generates an interrupt if a particular key is being pressed.
3. Same as 2 but operate on release of key "interruptOnKeyRelease(keyNumber)", not very ofter being used, but is a useful option to have.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fine! You are #1 that jumped in!
Since it is not always the time for main() to check for a key pressed all detected and debounced keys are stored in a small buffer from which they can be read off. Have a look at the Keypad matrix program I will integrate into the component here:
http://www.cypress.com/?app=forum&id=2233&rID=56644 Then you will get a feeling how it is supposed to work.
What do you want "The current of state the matrix" for??? There is no intermediate debounced matrix state.
I write this component to keep the user apart from the "Key down - Key release" mechanism like in windows.
I think of (as I wrote earlier) to supply a "KeyPressed" signal. To connect an isr to it and question for a particular key is easy and should be supplied by the user (as first implementation). And I want to keep it small for the first version.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Shall download and have a look.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is the next part of my experiences in creating a component. Since I have a lot of pictures to show and seemingly I may attach only a single file to my post, I decided to create a PDF-document that contains all the text and pictures.
Take your time, relax and have a look at. Any comments are welcome.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, the link to the videos does not work as expected, you'll have to cut and paste it into your browser's address.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks for the pdf. I must have watched those videos about 10 times by now, but this is a great little distillation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Where are the videos??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Right where all the links saying "video library" point to: http://video.cypress.com/video-library/video/PSoC
Some more can be found in the trainign area: http://www.cypress.com/?id=1162&source=support
The 'Training on Demand' area has even more: http://www.cypress.com/?app=search&searchType=advanced&keyword=&rtID=134&id=0&applicationID=0&l=0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As I stated in the post following: Add manually the given address found in the .pdf-file into your browser's address. The videos I'm talking about are numbered 110 to 113. Here is an actual link www.cypress.com/ .
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bob! How's everthing?
I want to ask you if the is an update of your keypad interface since you posted it? I suppose it can be used on psoc 5lp, right?
Thank you!
Regards
Edgard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is perfect for my home burglar alarm system I am building, thanks a lot!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Keypad component is not device-specific, so you may use it with PSoC3, 4, 5 or 5LP. You only should update the underlying components to their actual versions.
Bob