PSoC™ 4 Forum Discussions
text.format{('custom.tabs.no.results')}
Hello
I'm using actually PSOC4 CYBL10573.
I have actually calculate crc16 and i have already save it in the last 2 Bytes of Flash. I need to make a check for the CRC in main loop. That's why i used the same code (already used to calculate the crc after compilation)
The resulted CRC in main loop isn't the same with the precalculated .
when i try to find the problem with debugging, the first 4 Bytes of flash are correctly copied but the 5 Byte will not correctly copied. That's why the CRC is not the same.
Do you have any ideas about this case??
Show LessI have noticed that a pin configured as output with hardware connection, strong drive, can be driven from the hardware and read by the firmware, which I think could be used as a one bit status register.
I wonder if something similar can be done for a 1-bit control register. Is the digital side aware of the status of an output pin updated by the firmware? Would it work configuring the pin as bidirectional, with only the input connected to hardware, and use it from the firmware as output, strong drive?
Tony
Show LessHas anyone had any success using the SI Labs Temperature and Humidity Sensors?
I am unable to read the sensor reliably. There is a CRC check function that is validating the 1st, 3rd and 5th reads when I have a CyDelay(1), but nothing else. Without the delay (as shown below) the first read is valid, but no others. I have tried changing the delays up to 1000 with no difference.
<code>
float SI7013_readHumidity(void)
{
//Request a humidity reading
I2C_1_I2CMasterSendStart(SI7013_ADDRESS, I2C_WRITE);
I2C_1_I2CMasterWriteByte(MEASURE_RH_NOHOLD); // Register to write at.
I2C_1_I2CMasterSendStop();
//Hang out while measurement is taken.
CyDelay(130);
uint8 msb, lsb, checksum;
I2C_1_I2CMasterSendStart(SI7013_ADDRESS, I2C_READ);
msb = I2C_1_I2CMasterReadByte(I2C_1_I2C_ACK_DATA);
//CyDelay(1);
lsb = I2C_1_I2CMasterReadByte(I2C_1_I2C_ACK_DATA);
//CyDelay(1);
checksum = I2C_1_I2CMasterReadByte(I2C_1_I2C_ACK_DATA);
//CyDelay(5);
I2C_1_I2CMasterSendStop();
//CyDelay(5);
uint16 rawHumidity = ((unsigned int) msb << 😎 | (unsigned int) lsb;
if(SI7013_check_crc(rawHumidity, checksum) != 0) return(999); //Error out
//sensorStatus = rawHumidity & 0x0003; //Grab only the right two bits
rawHumidity &= 0xFFFC; //Zero out the status bits but keep them in place
//Given the raw humidity data, calculate the actual relative humidity
float tempRH = rawHumidity / (float)65536; //2^16 = 65536
float rh = -6 + (125 * tempRH); //From page 14
return(rh);
}
</code>
I am hoping that I am just doing something stupid here.
Parts are on a custom PCB. I2C traces are VERY close to matched. I am using the original library on an arduino connected to the sensor via a cable and it works fine. So it isn't the sensor.
I have attached the Project. I am using Creator 4.1 Update 1.
Show LessI'm using a CYBLE-222014-01 module and I downloaded a driver from ST Micro for their LIS3DH accelerometer (which according to ST is the same register set as LIS2DH which I am using).
In their code, ST provide 2 places where you have to build your own functions (they give 2 comment lines giving very basic suggestions) and I've written code that compiles but I'm looking for a check of understanding - note I'm hard-controlling the chip select (CS) line. Here's teh code ...
const uint8 READ = 0b10000000; // LIS2DH's read mask
const uint8 WRITE = 0b00111111; // LIS2DH's write mask
uint8 dataToSend;
u8_t LIS3DH_ReadReg(u8_t Reg, u8_t* Data) {
//To be completed with either I2c or SPI reading function
//i.e. *Data = SPI_Mems_Read_Reg( Reg );
// my code starts here
// combine the R/W register address and the command into one uint8
dataToSend = (Reg | READ);
ACC_CS_Write(0); // clear ACC_CS for access
SPI_SpiUartWriteTxData(dataToSend); // TM
*Data = SPI_SpiUartReadRxData(); // TM read data from the received buffer
ACC_CS_Write(1); // set ACC_CS
return 1;
}
/*******************************************************************************
* Function Name : LIS3DH_WriteReg
* Description : Generic Writing function. It must be fullfilled with either
* : I2C or SPI writing function
* Input : Register Address, Data to be written
* Output : None
* Return : None
*******************************************************************************/
u8_t LIS3DH_WriteReg(u8_t WriteAddr, u8_t Data) {
//To be completed with either I2c or SPI writing function
//i.e. SPI_Mems_Write_Reg(WriteAddr, Data);
dataToSend = (WriteAddr & WRITE); // TM set up write mask (NB the M/S bit is also 0 for single address
ACC_CS_Write(0); // clear ACC_CS for access TM ???? do we want to clear other CS or use a SPI busy flag ???
SPI_SpiUartWriteTxData(dataToSend); // TM send mask+address
SPI_SpiUartWriteTxData(Data); // TM send actual data to write
ACC_CS_Write(1); // set ACC_CS
return 1;
}
The bit that's confusing me is that the data sheet for the LIS2DH device indicates that for an SPI read, the register address is sent to the device and then the contents are returns in the next 8 bits, so for my LIS3DH_ReadReg() function, won't I need to throw away the first Bte I get back with the SPI_SpiUartReadRxData() function?
or maybe someone's trodden this path before and already has code they are willing to share?
Thanks in advance for any help.
Show LessHello,
Why can't I place the EEPROM simulation on the PSOC 4100S?
I need this PSCO for his 5 PWM devices but I need also the EEPROM. I could use it whithout problems on my old projects with the PSOC 4100.
Thanks for you quick reply
Regards Juan-Carlos
Show LessHi!
I was wondering whether is it possible to connect (VSSA and VDDA) to a different supply voltage other than that is being used for (VSSD and VDDD).
Also is it possible to connect VSSA to a slightly negative voltage, say -200mV as compared to VSSD which is referenced 0V for digital peripherals.
The configuration would look like:
VDDD = 3.3V
VSSD = 0V
VSSA = -0.2V
VDDA = 3.1V (VDDA-VSSA = 3.3V)
Thanks
Show LessI need to run a CRC test over the flash und it should an unit CRC value calculated and stored in the last 4 Bytes of flash in order to be verified with the current value during the microcontroller startup . In find a safety software library for CYC8C families which set the correct precalculated checksum.
For CYB10573 families how it could the correct CRC to the binary file be added
thanks
Show LessIs it possible to program external PSoC-4M chip using the kitprog on cy8ckit-043?
I have broken apart the kitprog portion of the cy8ckit-043 and have connected its SWD pins to external psoc-4m device. But it's not working.
Is it possible to program external chips using this method?
Thanks
Show LessI have 2 programs (attached),
One is an on/off program end the other one is an alarm simulation with capsense
on the psoc4 kit.
Now I want to combine these programs.
I've allready tried several combinations, but so far unsuccessfully.
Maybe someone can help me with it?
Some words are in dutch like:
huidigestand means current state
vorigestand means previous state
TOETS1 means button1
Show LessHello,
I was using CY8CKIT-044 Psoc 4 M-Series Pioneer kit . By mistake CY8C5868LTI-LP039 got burn and now i can not able to program and read through USB to CY8C4247AZI-M485 IC .
Is it any possibility to fix this board if i change CY8C5868LTI-LP039 IC ?
Require firmware for CY8C5868LTI-LP039 to make clone as previous ?
Note- I have MiniProg3 to flash again CY8C5868LTI-LP039 , but i don't have firmware file ?
Best Regards
Deepak Aagri
Show Less