cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC Creator & Designer Software

Bob_Marlowe
Expert II
0 Likes
17 Replies
Bob_Marlowe
Expert II

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

0 Likes
Anonymous
Not applicable

May I know what is the purpose of the keyboard buffer?

   

Keyboard buffer size (2..20)

0 Likes
Anonymous
Not applicable

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.

0 Likes
Bob_Marlowe
Expert II

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

0 Likes
Anonymous
Not applicable

 Shall download and have a look.

0 Likes
Bob_Marlowe
Expert II

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 

0 Likes
Bob_Marlowe
Expert II

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

0 Likes
Bob_Marlowe
Expert II

Here I supply a small project that summarizes the above given component-creation.

   

A configurable matrix-input for a keypad.

   

 

   

Bob

0 Likes
crcac_264396
New Contributor II

 thanks for the pdf. I must have watched those videos about 10 times by now, but this is a great little distillation.

0 Likes
Bob_Marlowe
Expert II

Here we are. I finished the project and the documentation.

   

I invite everybody to share his comments on my KeyPad component

   

 

   

Happy reading

   

Bob

0 Likes
EdUc_284901
New Contributor II

Where are the videos??

0 Likes
HeLi_263931
Honored Contributor II

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

0 Likes
Bob_Marlowe
Expert II

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

0 Likes
EdUc_284901
New Contributor II

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

0 Likes
SaWa_284216
New Contributor II

 This is perfect for my home burglar alarm system I am building, thanks a lot!

0 Likes
EdUc_284901
New Contributor II

Hello samwalsh01

   

Can I use it with PSoC 5LP?? Thank you!

   

Edgardo

0 Likes
Bob_Marlowe
Expert II

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

0 Likes