HID over I²C (with 12 key encoder)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Keyboard encoder/decoder to HID over I²C 

   

I have a 12 key keypad that I plan to use in a Windows 10 system I am building. Well, building 255 of them for now and more later so the inexpensive CY8CKIT-049-42xx kit I think will work best for me. Plus with the USB to UART part removed, it fits nicely on the back of the keypad if I line up the input pins of the PSoC. I figure on taking in the 8 pins and logically assigning them to a value (IF row_1 AND col_1 THEN output "1") so if we need to rearrange keys, say phone layout to calculator, we can just change the assignments. 

   

Can you point me to examples of using I2C to put out data in such a way? I will be connecting to the I2C of an Up board which has near identical GPIO as the Raspberry Pi-3.

0 Likes
1 Solution
Anonymous
Not applicable

Ah, my bad alexander. I thought you were looking for a way to encapsulate the data to do it for windows specifically 🙂

   

The PSoC has example I2C projects in the PSoC creator samples as well as some online;

   

Here's the online information/examples that can help: http://www.cypress.com/forum/known-problems-and-solutions/i2c-example

   

​This page has several I2C examples that should be helpful for understanding the I2C bus/setup: http://www.cypress.com/documentation/code-examples/psoc-345-code-examples

   

Questions about setting up the PSoC as the slave: http://www.cypress.com/forum/psoc-4-architecture/i2c-communication-psoc-4-api-query

   

And an example to go with that scenario: http://www.cypress.com/documentation/code-examples/ce95364-i2c-slave-using-serial-communication-bloc...

   

Otherwise, the PSoC creator has documentation on the I2C components (datasheets) with sample code, examples, and example projects that implement I2C protocols for both slave and master.

View solution in original post

0 Likes
6 Replies
Anonymous
Not applicable
0 Likes
Anonymous
Not applicable

Thank you, yes that is the specifications of what the output is to look like. So looking for examples of how to set up the I2C module to do that from the PSoC4.

0 Likes
Anonymous
Not applicable

Ah, my bad alexander. I thought you were looking for a way to encapsulate the data to do it for windows specifically 🙂

   

The PSoC has example I2C projects in the PSoC creator samples as well as some online;

   

Here's the online information/examples that can help: http://www.cypress.com/forum/known-problems-and-solutions/i2c-example

   

​This page has several I2C examples that should be helpful for understanding the I2C bus/setup: http://www.cypress.com/documentation/code-examples/psoc-345-code-examples

   

Questions about setting up the PSoC as the slave: http://www.cypress.com/forum/psoc-4-architecture/i2c-communication-psoc-4-api-query

   

And an example to go with that scenario: http://www.cypress.com/documentation/code-examples/ce95364-i2c-slave-using-serial-communication-bloc...

   

Otherwise, the PSoC creator has documentation on the I2C components (datasheets) with sample code, examples, and example projects that implement I2C protocols for both slave and master.

0 Likes
Anonymous
Not applicable

Thank you. I will look at these examples. Yes, by the way, it is specifically for Windows. So the earlier link is what I was going by as a guide to what the results should look like. I'm thinking for it to appear as a device (keypad) on the Windows system the PSoC's I2C module should be master?

0 Likes
Anonymous
Not applicable

I think the windows OS will run the motherboard with the I2C as Master, which means that the PSoC should be configured for slave mode? I could be wrong however; having trouble finding documentation on windows handling I2C communications devices.

   

The master is the one running the clocking-signal; If each I2C device plugging into the windows computer ran it's own clocking, then the computer with Windows on it would have trouble keeping track of many devices using I2C. On the other hand, if Windows was the master for the I2C, then it could send out a consistent clocking for accessing all of the devices. This is why I would expect the Windows-side to be the master, and the PSoC to be the slave.

0 Likes
Anonymous
Not applicable

Pulling my hair out on this one. Serial communication shouldn't be this difficult. I'm glad I only bought 55 of these but if anyone can write a 12 to 16 key keypad encoder to HID over I2C preferably for the CY8KIT-049-42xx PSoC or one in that price range, I will not only buy at least 200 more PSoC's but pay you for the open source code as well. It should be much simpler than the USB and BLE versions that have already been done for some of the more expensive kits. Apparently the I2C standard has only a limited number of the descriptor fields used for USB. I've spent too much time trying to convert or build from the other code examples that I should have just invented a new language and programmed it from scratch.

0 Likes