PSoC™ 5, 3 & 1 Forum Discussions
text.format{('custom.tabs.no.results')}
I couldn't find a useful PS-2 keyboard routine that would produce ASCII codes. This project does that and it includes use of the Shift keys to get upper-and lower-case characters and symbols. Decoding works for only the main keyboard area and doesn't decode the Print Screen, Insert, Delete, and other keys on the right side of the main keys. You could add these as needed. You can add a value for the Fx keys, also. The example includes an array for upper-case and an array for lower-case values that have ASCII codes. Spaces are "saved" with 0x0 so you can insert a code for, say, the F4 key that generates the keyboard scan code of 0x0C. Find that location in the array and substitute the code you want the F4 key to provide. I have included a table of the keyboard-to-ASCII translations that lists all the bytes for both arrays with an index between 0 and 0x7F. This information helps you locate a keyboard scan code and insert the ASCII value you want to produce when pressed. I also include a flow chart that shows how the code operates.
When you press a key, a PS-2 keyboard sends information in an 11-bit serial stream that looks like a UART transmission (LSB first). Each key has an assigned non-ASCII code. This code remains the same when shifted or unshifted. The software looks for the shift key and handles data accordingly. When you release a key, the keyboard send a "key-release" byte (0xF0) followed by the code for the letter. Software handles this, too. A clock signal from the keyboard will strobe the bits into an SPI register. I used the LSB first and mode 1,1, as included in this project.
In typical use you would use the SPI port to generate an interrupt, but the example code simply runs an infinite "keyboard input" routine and echoes characters to a terminal program. This setup makes the software easy to test. I used a CY8CKIT-059 5LP Prototyping Kit. I monitored keyboard data with an Saleae Logic analyzer and ran the Parallax Serial Terminal on my Win-10 PC to check the ASCII output from the project. Have fun. Jon Titus, Herriman, UT
Show LessWe are sending data using MasterWriteBuf API of I2C.
Its API is defined below.
uint8 I2C_MasterWriteBuf(uint8 slaveAddress, uint8 * wrData, uint8 cnt, uint8 mode)
According to this API, since wrData is uint8, it is 256 pieces.
.
We would like to transmit more than 256 data.
Is it possible to realize it?
Show LessGood evening. I have a test project running on CY8CKIT_059 that uses both the USB UART and the UART (Kitprog port). The protocol used by both ports is configurable.
I am able to read data from PSOC on the two ports at the same time with two PUTTY sessions. Problem is that when I turn off the session reading from USB COM port, the other port will halt sending commands.
This is because I write to both ports, and on USB side there's the 'classic' cycle that waits the USB to be ready for transfer:
while (0u == USBCOM_CDCIsReady());
USBCOM_PutString(s);
This does not happen on the serial port.
What's the best strategy to detect full buffer (or better COM port not open by any program/not active)? Also is there a way to detect port reopening as to suspend send and clear the buffers befrore restarting the serial stream?
Thanks
Marco
Show Lesshello I am currently using PSoc5 LP-096 in my project and i have 2 questions
1)On the board I wanted to messure the voltage between the 5V and GND(ground) how ever when i messured it the voltage was 4.06V and not 5V why is that ?
2) I am using ADC block and my question is what is default Vref ? the reason i am asking is that if the Vref is 5 and in real messirment it gives me 4.06V it gives me wrong answer of the Output of the ADC
Show LessHello,
I have a CAN based Bootloader and I managed to flash a PSOC5 board with specific code. It works as expected until I disconnect the power supply. Then the bootload process remains in the WAIT_Forever state even though I set the Bootloader component to wait for command a specific time (5 seconds).
I think my problem is related with this thread Serious bug in bootloader component. Is there a workaround? I tried to add CySetTemp() in bootloader project before CyBtldr_Start() and it does not works.
Show LessI'm a bit stuck programming the "save to eeprom" functionality of the CY8C9560A. Since the command value 0x01 is broken (per datasheet errata), I am trying to replicate that functionality with commands 0x06 (read device configuration) and 0x03 (write configuration to EEPROM). Here's my status so far:
- I have two I2C objects (addresses 0x20 and 0x50 for the volatile and EEPROM device functions, respectively). I am able to connect to the EEPROM I2C address after enabling it using the enable register (0x2D).
- I have successfully read out the 146-byte configuration information by reading the command register 0x30, setting command 0x06 to read the device configuration, then reading the 146 byte payload and checking the CRC. That works fine, and I get the configuration values that I expect to get. In fact, all single-register reads and writes are working great, so this "save" functionality is the only missing piece.
- When I try to write this data back to EEPROM, the device doesn't ACK, which indicates the packet is malformed or the CRC check failed. But I don't see what the issue is. The packet I'm sending is the following, and I'm writing it to the volatile I2C device (address 0x20). I have also tried writing it to the EEPROM address (0x50), but that doesn't work either.
COMMAND = 0x30
COMMAND_VAL_WRITE_EEPROM_CONFIG = 0x03
PAYLOAD = <146 bytes read out from device>
CRC = 0x00 ^ PAYLOAD[0] ^ PAYLOAD[1] ^ ... ^ PAYLOAD[145]
COMMAND, COMMAND_VAL_WRITE_EEPROM_CONFIG, PAYLOAD, CRC
Show LessWe would like to be able to operate SD card from PC using USB and emfile component in PSoC 5LP.
Is it possible to combine these two components?
Do you have such experience in the past?
We would like to obtain a sample project if possible.
Hi,
I'm trying to get bootloader with SPI transport to work. I have something that usually works, but it's very fragile - basically the PSoC bootloader logic doesn't handle extra bytes in the communication very well.
The issue with SPI (vs UART) is that the host need to send data in order to read data from the slave (=PSoC). This data ends up in the incoming buffer on the PSoC side, and the bootloader will fail when it contains unexpected data. We have tried to send 0x00 and 0x01 from the host as dummy data (while reading data from the slave), but in both cases it fails.
The bootloader protocol should allow both these numbers as 'dummy data' that is thrown away - the bootloader doesn't seem to have proper parsing (that is, erroneous data in the incoming buffer should be thrown away).
Our current 'solution' is having sleeps here and there in the host code that make sure that we only read when the PSoC is ready. However, this is very error-prone and slow.
Is there a solution to this? I know I can fix it on the PSoC side by overriding CyBtldrCommWrite, parse the data received and only deliver it to the bootloader logic in case it's valid bootloader protocol data - but should I really have to do that? It really should be handled by the bootloader internally.
Thanks, Jacob
Show LessLately I find that Microsoft Windows 7 thinks it knows what is best. I have disabled and uninstalled the Microsoft's driver
associated with my CY8CKIT-059 PSOC 5LP Prototyping Kit multiple times. Then I unplug the board from my hub and
reinstall it. I tell it to use the location of the ProgKit driver and it responds that it has chosen the best driver which of
course is the Microsoft driver.
The debugger port does get to use the KitProg driver (setup as a USB bus controller -> USB Composite Device). Its just the Human Interface Devices -> USB Input Devices which seems to use the Microsoft HID driver. See the attached picture. Any ideas ?
Randy
Show LessHello,
I need your help please.
I'm working now on CY8CMBR3108 module.
I need to configure the CY8CMBR3108 module through the I2C bus
I used the EZ-Click 2.0 SP2, to generate the configuration file (attached file) for my project.
Observed behavior:
At the initialization through the I2C frames:
1. The device is checked:
result: A valid MBR3 device is connected on I2C bus
2. An I2C request is sent to read CTRL_CMD register.
result: The read command is 0, so the Device is not busy.
3. Through I2C bus, the frame to configure the Touch Controller is sent (Frame length = 129 Bytes). The configuration used is attached to this message.
result: No error is detected during the tramission of the frame.
4.A SAVE_CHECK_CRC command to validate the new configuration data.
result: No error is detected during the tramission of the frame..
5. After 300 ms, An I2C request is sent to read CTRL_CMD register.
result: The read command is 0xFF, so the Device reset itself.
This is my issue: At step 5: Even after waiting 3 or 5 seconds, the device stays in "reset itself" status.
My questions:
1. Why this issue occurs ?
2. How to fix that please ?
Thanks by adavance.
Best regards,
Cindy
Show Less