PSoC™ 5, 3 & 1 Forum Discussions
Hello-
I'm new to the PSoC world and I need some help. I have a program that has two timing variables that I can change through the mini-USB UART port while the program is running (with Putty). What I would like to do is be able to save the changes to a memory location so that when the power is recycled, the PSoC recalls the last saved value. The only user communication connection to the PSoC will be the mini-USB.
I'm using the following kit: CY8CKIT-059 5LP
Using two variables to control the length of time for CyDelay within a function.
uint32 ftime =(3000); //3 Sec default - Variable #1
uint32 btime =(3000); //3 Sec default - Variable #2
I'm using a switch statement to be able to vary these timings anywhere from 1 - 5 secs depending on user preference.
I'm using the uint32 because that is data type that the CyDelay wanted. What would be the easiest way to do this? I've looked at both em_EEPROM and Flash but I'm too unexperienced to figure it out. My program is also printing status updates to the USB port. Is it possible to display the recalled value on the USB port? Attached is my project, please be kind as this is my first time working with PSoC and writing C code . If anyone has example code or wants to tweak mine, it would be greatly appreciated.
Thank you,
Henry
Show LessHi everyone,
I want to save some data using EEPROM component. But I don't know how to do it since EEPROM only except uint8 data type.
But I want to save data which are of String data type. For example, if I want to save this line on EEPROM from my code: {\"ADC\": %.0f , \"LM35\": %.1f , \"TC74\": %.0f , \"SPI\": %.1f }\r\n", average, temp, I2Cavg, SPIavg);. How can I actually do this? I am attaching my code. What I am trying to do is save all the data on EEPROM
which I am showing via UART and in the end how can I download all the data from EEPROM as a text document on my PC.
Best Regards,
Nasir Ahmed
Show LessHi everyone,
I Need your help. I started to work with PSoC 5LP and I want to have a terminal set up with UART.
If I press T hh:mm = sets the current time for the device and if I write T? = prints the current device time.
How i get the Output, i have a Char for the Input of the terminal?
Char= UART_GetChar();
but not a Char Array... I don't know how to change it.
Thanks a lot.
Best
Marcel
Show LessI'm trying to control Wiznet W5300 (Parallel to Ethernet Chipset) using EMIF.
This chip use address line 10 bits and memory that uses Little Endian.
I have two issues now.
1. I couldn't find a way to adjust the timing of EMIF.
https://www.wiznet.io/wp-content/uploads/wiznethome/Chip/W5300/Documents/W5300_DS_V134E.pdf
(Page 124 ~ 125. Register Read, WRITE Timing)
How can I adjust the timing of EMIF?
2. about address line designation cannot be specified only as a multiple of 8.
Do I need to use 16 bits to use the address of EMIF as 10 bits?
Thank you for reading it and let me know if you know what this is about.
Show LessHi, I looking for any psoc5 uC with interface qspi or similar and i cant find any one, but I found this pdf https://www.cypress.com/file/380711
On the picture I see qspi memory conneted with psoc 5LP uC via 4 data lines, so i want to ask there is any psoc5 have this interface or similar interface with different name?
Hello, I am having problems with the classic stuck I2C slave problem. The PSoC 5LP is the master, and if we get a glitch on the bus, the slave get stuck waiting for a clock pulse, and may hold the SDA line low. The solution is to toggle extra pulses on the SCL pin until the slave I2C slave device is synced back up and releases the SDA pin.
I am am trying to implement this recovery routine, but I am having trouble taking over the SCL pin and using the I2C_SCL_Write() and I2C_SCL_Read() functions. There must be a register that connects these pins to either the UDB I2C implementation of the FF I2C implementation. On the PSoC 4 forum, this function is listed as:
CY_SET_REG32(CYREG_HSIOM_PORT_SEL4, 0x00000000);
But CYREG_HSIOM_PORT_SEL4 does not exist on the PSoC 5LP. Any help with how to do this would be greatly appreciated.
Right now, in an attempt to take over the SCL and SDA IOs, I am using the following code. The SCL wire remains a constant high, despite calling the I2C_SCL_Write() function:
va_print("Restarting module attempt %d\r\n", i);
MI2C_Stop();
CyDelay(10);
//set IO to GPIO from I2C
MI2C_SDA_SetDriveMode(MI2C_SDA_DM_DIG_HIZ);
MI2C_SCL_SetDriveMode(MI2C_SCL_DM_DIG_HIZ);
sdaRead = MI2C_SDA_Read();
sclRead = MI2C_SCL_Read();
va_print("SDA pin %d, SCL pin %d\r\n", sdaRead, sclRead);
va_print("Toggling SCL\r\n");
MI2C_SCL_SetDriveMode(MI2C_SCL_DM_OD_LO);
MI2C_SDA_SetDriveMode(MI2C_SCL_DM_OD_LO);
MI2C_SCL_Write(1);
MI2C_SDA_Write(1);
CyDelay(1);
int j;
for(j = 0; j < 30; j++){
va_print("Toggling loop %d\r\n", j);
MI2C_SCL_SetDriveMode(MI2C_SCL_DM_OD_LO);
MI2C_SDA_SetDriveMode(MI2C_SCL_DM_OD_LO);
CyDelay(1);
MI2C_SCL_Write(0);
CyDelay(1);
MI2C_SCL_Write(1);
CyDelay(1);
MI2C_SCL_SetDriveMode(MI2C_SCL_DM_DIG_HIZ);
MI2C_SDA_SetDriveMode(MI2C_SCL_DM_DIG_HIZ);
sdaRead = MI2C_SDA_Read();
sclRead = MI2C_SCL_Read();
va_print("SDA pin %d, SCL pin %d\r\n", sdaRead, sclRead);
if(sdaRead != 0 && sclRead != 0){
va_print("Toggle recovery good, exiting on toggle loop %d\r\n", j);
break;
}
}
va_print("SDA pin %d, SCL pin %d\r\n", sdaRead, sclRead);
if(sdaRead != 0 && sclRead != 0){
va_print("GPIO recovered on attempt %d\r\n", i);
MI2C_SCL_SetDriveMode(MI2C_SCL_DM_OD_LO);
MI2C_SDA_SetDriveMode(MI2C_SCL_DM_OD_LO);
MI2C_SCL_Write(1);
MI2C_SDA_Write(1);
MI2C_Init();
MI2C_Enable();
CyDelay(10);
break;
}
Someone here must know how to do this! Any help would be appreciated.
Show LessDon't think I'm the only one to have this problem but being new to using the Cypress Developer Community I don't know how to find the answer. So sorry in advance if I'm duplicating a question.
I need to use an SD Card in my latest design so I started by downloading the emFile_Example01. I've downloaded all the necessary files as instructed and set up the Build Settings to look for the necessary include file etc. Once again as instructed in the FileSystemLibrary(emFile).pdf.
However, build fails:-
ERROR: cannot find -lC:\emFile_V322c\LinkLibrary\PSoC5\GCC\libemf32nosnlfn.a
collect2.exe: error: ld returned 1 exit status
The command 'arm-none-eabi-gcc.exe' failed with exit code '1'.
--------------- Rebuild Failed: 06/01/2020 11:52:47 ---------------
The directory/file path is correct. I've checked and re-checked. Help please. Could there be something simple that I have forgotten to do?
Thanks in advance,
Dafydd
Show LessI want to use External Reference when using ADC.
However, there is no description of "SAR0 ExtRef" in the datasheet.
In PSoC Creator, P0 [4] is assigned as ExtRef.
And, In AN61290, P0 [4] is described as SAR0 ExtRef.
https://www.cypress.com/file/44581/download
Can I use this pin as a SAR0 ExtRef?
Thanks,
Tetsuo
Show LessHi all,
I am working on developing an RC car for which I need a controller and a receiver. This of course means the communication is through radio. The way it works is by sending multiple packets of data between each radio device.
I am sending a total of 10 bytes of data, the first 3 being start bytes being three chars: 's', 't', 'r' which signal the start of the message. The following bytes are anything from the steering angle to the motor speed of the rc car (along with a few other commands).
The problem I am having is the following: I a, sending 10 bytes of data and on the receiver side, everything seems fine, however, sometimes wrong bytes will begin to be written to the wrong byte on the receiver side. For the transmitter, I am using the UART_PutArray() command in order to send multiple bytes, and on the receiver side, I am using an interrupt on each byte received using the handler to unpack the bytes and assign them to the right index o the receiver buffer. Any help on this is appreciated.
I am attaching both projects to this comment..
Show Less