PSoC™ 5, 3 & 1 Forum Discussions
Hi
I would need help to understand why a Timer does not start to count down.
I've attached a bundle with 2 timers, the first one is one shot software only settings and works oK.
The second one, has software and Harware setting, but the code get stuck reading the counter.
Both codes are similar a exception the second one is enabled for a control register.
Thanks
Show LessHello,
In PSOC5 I have to read I2C as slave.
I wrote the following code:
/***********************************************************************/
int I2cOpen (void)
{
I2C_4_SlaveInitReadBuf ((uint8 *)readBuffer,64);
I2C_4_Start();
}
/***********************************************************************/
int I2cReadSlave ( void *pDataRead, int ReadSize)
{
int rc;
int stat;
uint8 byteCnt;
I2C_4_SlaveClearWriteStatus ();
I2C_4_SlaveInitWriteBuf ((uint8 *)pDataRead,ReadSize);
// uBalz finished write to I2c Slave pSoc a Request.
while(1)
{
stat = I2C_4_SlaveStatus() & I2C_4_SSTAT_WR_CMPLT;
if (stat !=0)
break;
vTaskDelay(50 / portTICK_PERIOD_MS);
}
byteCnt = I2C_4_SlaveGetWriteBufSize();
if (byteCnt>0)
{
printf("Send size: %d\n",byteCnt);
}
return I2C_OK;
}
Can you please tell that my code is correct ?
I2cOpen is called during init only.
Then I have a while (1) that calls I2cReadSlave for reading requests sent from external host.
Thank you,
Zvika
Show LessHello,
we have CY8C5888LTQ type and CY8C5888LTI
we want to be able to read from the .hex file that is generated to which type it is targetted to.
how can i know (from which bytes of the .hex file) if it is LTQ or LTI
Thank you
segev
Show LessHi,
I am new to the PSOC platform and have been impressed playing with the PSOC 5LP CY8CKIT-050.
Could somebody please link me to where I could download the example library project "Peak_Detector_Component.cywrk" as mentioned in the document "Peak Detection with PSoC 3 and PSoC 5LP"
Show Less
Just sharing that we wanted the chip to actually reset after DAP_ReleaseChip.
We had to enable the allow_rst_hard (bit 6) in the MLOGIC_DEBUG register to achieve this, additional to the SetAcquireMode "Reset"
SetAcquireMode "Reset"
DAP_WriteIO 0x400046E8 0x00000040
DAP_ReleaseChip
In my project with a PSoC 5LP the CyDelay functions runs 4 times too slow.For verification, I toggeled a digital output in a loop with CyDelay(100) between the output changes. Measured with an oscilloscope, the CyDelay(100) takes 392 ms.
Any ideas how to fix?
Show LessI want to change amplitude and frequency in wave Dac with current source.
In first iteration I get the signal, But after the this I am not able to get signal in second iteration.
Same thing is working If I use voltage source of wave dac.
This is my sample code .
Please give solution.
#include <project.h>
void Wave_Scale(const uint8 *wave, uint8 *wave_scaled, uint16 wave_len, float scale)
{
uint16 i;
for (i = 0; i < wave_len; i++)
{
wave_scaled[i] = (uint8)(((float)wave[i]) * scale);
}
}
int main(void)
{
CyGlobalIntEnable;
uint8 wave_sram[100] = {0};
while (1)
{
// First iteration - Generate sine wave with scale 0.5
WaveDAC8_1_Stop();
Wave_Scale(WaveDAC8_1_wave1, wave_sram, 100, 0.5);
WaveDAC8_1_IDAC8_Init();
WaveDAC8_1_Wave1Setup(wave_sram, 100);
WaveDAC8_1_DacClk_SetDividerRegister(23 , 1);
WaveDAC8_1_Start();
CyDelay(10000);
// Second iteration - Generate sine wave with scale 0.8
WaveDAC8_1_Stop();
Wave_Scale(WaveDAC8_1_wave1, wave_sram, 100, 0.8);
WaveDAC8_1_IDAC8_Init();
WaveDAC8_1_Wave1Setup(wave_sram, 100);
WaveDAC8_1_DacClk_SetDividerRegister(23 , 1);
WaveDAC8_1_Start();
CyDelay(10000);
}
}
I know the Project Build settings for the linker are supposed to have newlib nano float enbled with added libraries of m; c; gcc; g. This has always worked in the past. Now using 4.4 I am finding I cannot both print and scan floating point, only one or the other. I can scan, but not print if nano float is true but regular newlib false {this used to work}. If both are true I can only print, but not scan.
Show Less