PSoC™ 5, 3 & 1 Forum Discussions
Hi, I'm using PSoC 5LP CY8CKIT-059 and I have a problem with the bootloader host programm. I'm trying to test my I2C Bootloader with a bootable blinking LED project. When I try to program the cyacd. file I get the message "The bootloader reported error 'Command not recognized". I am a beginner and this is my first project.
Thanks for your help.
Show LessHi,
I'm using PSOC5 (CY8C5888AXI-LP096) and no matter how I reset my device, watchdog or power shutdown, when I startup the chip and read CyResetStatus it is always 0x20 which is preserved to 'software reset' as I see in CyLib.h
CY_RESET_LVID (0x01u)
CY_RESET_LVIA (0x02u)
CY_RESET_HVIA (0x04u)
CY_RESET_WD (0x08u)
CY_RESET_SW (0x20u)
CY_RESET_GPIO0 (0x40u)
CY_RESET_GPIO1 (0x80u)
Can anyone help me understand how do I know which kind of reset was it?
Thanks in advanced.
Show LessHello,
I'm developing a 4 key capsense PCB with CY8C20447S (with shield and guard)
I'm testing the SmartSense_EMCPLUS User Module and it works well, but I can't detect a permanent touch (the detection goes OFF after some time, one-two seconds)
I'd like to know if it's a limitation of the UM or should I be able to achive a long lasting touch.
Thanks.
Show LessHello,
I have five 10k-ntc, each with 10k reference-resistor. For voltage-reference i use an op-amp-component as follower and vref-component at 1024 mV.
In this configuration, my Output-voltage breaks down to 560 mV. The load-current is about 90 uA. If I am right, the op-amp-component should give up to 25 mA.
Has anyone experienced the same issue?
Show LessHello,
I'm trying to configure a filter with 16 bits data from an ADC DelSig. I have configured the coherency to MID in the ADC and the filter and the "dalign" is enabled in the filter. I think that I have configured the DMA properly. Howver when I see the data filtered, it have some noise. Originally I was reading a sensor wih the ADC but later I have try with a potenciometer with the same result.The noise appear when the voltage cross VDD/2. What could be the problem? Thank you
Show Less
Your discussion "PSoC Today! - Synchronous Detection Part xx" sort of nails what I want to do with a fluxgate magnetometer project (similar to LVDT transducer application) but I find the video a bit glib, and would really like a resource that guides me through the modifications to the ADC etc to produce the working project.
Are the design files available to help me create a working prototype ?
Show LessHi-
I am experimenting with the filter component and storing its output using DMA. The filter datasheet says this:
DMA Request – Output *
If either channel is configured to generate a DMA request in response to a data-ready event, the DMA Request output is enabled for that channel. Each channel has a separate DMA Request output. Connect the hardware signal to a DMA component to handle the DMA routine.
The DMA Request output signal is sticky and will stay high until read. Ensure that each sample is read from the output before the next one is available. Since there is no local buffering, failure to read out a sample during this period means that the output will be over-written.
So, does this mean that, even though the DMA moves the filter data to my location of choice, I still need to perform either a Filter_Read8(), a Filter_Read16(), or a
Filter_Read24() to reset the DMA Request Output signal?
If this is the case (and it certainly seems to be), is there really any benefit to using the DMA transfer over simply reading the data into a memory location using the filter ISR?
Thanks,
Rob
Show LessHello everyone,
iam new to psoc and iam facing error : Build error: 'i2c_sendbyte': requires ANSI-style prototype
THIS IS THE CODE
#include<project.h>
#include"i2c.h"
uint8 i2c_Send(uint8 Address,uint8 *Data,uint8 Num)
{
i2c_start();
//-- Send Addresss
i2c_sendbyte(Address & 0xFE); //-- Lowest bit = 0 => WRITE //error line
if(!i2cgetack())
{
i2cstop();
return(0);
}
while(Num--)
{
i2c_sendbyte(*Data);
if(!i2cgetack())
{
i2cstop();
return(0);
}
Data++;
}
i2cstop();
return(1);
}
uint8 i2c_Read(uint8 Address,uint8 *Data, char Num)
{
i2c_start();
//-- Send Address
i2csendbyte(Address | 0x01); //-- Lowest bit = 1 => READ
if(!i2c_getack())
{
i2cstop();
return(0);
}
while(Num--)
{
*Data=i2c_getbyte();
Data++;
if(Num > 0)
{
i2c_sendack();
}
}
i2c_stop();
return(1);
}
uint8 i2c_getbyte(void)
{
char count,Byte=0;
int delay;
SCL_Write(0);
SDA_SetDriveMode(SDA_DM_OD_LO);
for(delay=0;delay<I2CCLOCKLOW;delay++);
//i2cdelay(I2CCLOCKLOW); //-- Minimum Clock Low Time
for(count=8;count>0;count--) //-- Read 8 bits of data
{
Byte=Byte <<1;
SDA_SetDriveMode(SDA_DM_DIG_HIZ);
if(i2creadbit())
{
Byte +=1;
}
}
return(Byte);
}
char i2c_readbit(void)
{
char Data=0;
int delay;
//i2cdelay(I2CDATASETTLE); //-- Minimum Clock Low Time
for(delay=0;delay<I2CDATASETTLE;delay++);
SCL_Write(1);
//i2cdelay(I2CHALFCLOCK); //-- 1/2 Minimum Clock High Time
for(delay=0;delay<I2CHALFCLOCK;delay++);
if(SDA_Read() !=0 ) Data=1; //-- READ in the data bit
//i2cdelay(I2CHALFCLOCK); //-- 1/2 Minimum Clock High Time
for(delay=0;delay<I2CHALFCLOCK;delay++);
SCL_Write(0);
//i2cdelay(I2CCLOCKLOW); //-- Minimum Clock Low Time
for(delay=0;delay<I2CCLOCKLOW;delay++);
return(Data);
}
void i2c_sendack(void)
{
int delay;
//--- Send Ack to slave except for last time ---
SDA_SetDriveMode(SDA_DM_OD_LO);
//i2cdelay(I2CDATASETTLE); //-- Give it time to settle
for(delay=0;delay<I2CDATASETTLE;delay++);
i2cclock(); //-- Pulse the clock
SDA_SetDriveMode(SDA_DM_DIG_HIZ);
//i2cdelay(I2CDATASETTLE); //-- Gap between next byte
for(delay=0;delay<I2CDATASETTLE;delay++);
}
//************** END OF i2csendack
void i2c_stop(void)
{
int delay;
//-- Generate Stop Condition --
SDA_SetDriveMode(SDA_DM_OD_LO);
SCL_Write(1);
//i2cdelay(I2CSTOPDELAY);
for(delay=0;delay<I2CSTOPDELAY;delay++);
SDA_SetDriveMode(SDA_DM_DIG_HIZ);
}
void i2c_start(void)
{
int delay;
//data goes low with clock high - start condition
SDA_SetDriveMode(SDA_DM_OD_LO);
//i2cdelay(I2CCLOCKLOW); //-- Minimum Clock Low Time
for(delay=0;delay<I2CCLOCKLOW;delay++);
}
/*void i2c_delay(int delay)
{
int i;
for(i = 0;i < delay;i++);
}*/
void i2c_sendbyte(uint8 Byte)
{
char count;
int delay;
SCL_Write(0);
//i2cdelay(I2CCLOCKLOW); //-- Minimum Clock Low Time
for(delay=0;delay<I2CCLOCKLOW;delay++);
for(count=8;count>0;count--) //-- Send 8 bits of data
{
if( (Byte & 0x80)== 0) //-- Get the Bit
{
SDA_SetDriveMode(SDA_DM_OD_LO);
//-- Ensure Port pin is low
}
else
{
SDA_SetDriveMode(SDA_DM_DIG_HIZ);
//-- Release pin if bit = 1
}
Byte=Byte<<1; //-- Shift next bit into position
i2cclock(); //-- Pulse the clock
/*
//for(delay=0;delay<I2CDATASETTLE;delay++);
SCL_Write(1);
// for(delay=0;delay<I2CCLOCKHIGH;delay++);
SCL_Write(0);
//for(delay=0;delay<I2CCLOCKLOW;delay++);
*/
}
//SDA_TRIS=I2CHIGH; //-- Release data pin for ACK
SDA_SetDriveMode(SDA_DM_DIG_HIZ);
}
void i2c_clock(void)
{
//int delay;
//i2cdelay(I2CDATASETTLE); //-- Minimum Clock Low Time
// for(delay=0;delay<I2CDATASETTLE;delay++);
SCL_Write(1);
//i2cdelay(I2CCLOCKHIGH); //-- Minimum Clock High Time
// for(delay=0;delay<I2CCLOCKHIGH;delay++);
SCL_Write(0);
//i2cdelay(I2CCLOCKLOW); //-- Minimum Clock Low Time
// for(delay=0;delay<I2CCLOCKLOW;delay++);
}
char i2c_getack(void)
{
int i,j;
int dat;
int delay;
SCL_Write(0);
//i2cdelay(I2CCLOCKLOW); //-- Minimum Clock Low Time
for(delay=0;delay<I2CCLOCKLOW;delay++);
SCL_Write(1);
//i2cdelay(I2CHALFCLOCK); //-- wait for 1/2 the clock pulse
//i2cdelay(22); //-- wait for 1/2 the clock pulse
for(i = 0;i < 2000;i++)
{
for(j = 0; j<10;j++);
dat = SDA_Read();
if(!dat)
break;
}
//if(SDA_Read()) //-- sample the ACK signal
if(dat) //-- sample the ACK signal
{/
return(0); //-- No ACK so return BAD
}
//i2cdelay(I2CHALFCLOCK); //-- Else wait for rest of clock
for(delay=0;delay<I2CHALFCLOCK;delay++);
SCL_Write(0); //-- Finish the clock pulse
//i2cdelay(I2CCLOCKLOW); //-- Minimum Clock Low Time
//i2cdelay(I2CCLOCKLOW); //-- Minimum Clock Low Time
for(delay=0;delay<I2CCLOCKLOW;delay++);
for(delay=0;delay<I2CCLOCKLOW;delay++);
return(1);
}
/* [] END OF FILE */
please help me
Show LessThis is probably pretty basic, but I'm still relativity new to coding, and suggestions or different ways of doing this will be appreciated. Basically what I'm trying to do is read 8 pins of the PSoC that are connected to external on off switches (done). There are also 8 devices connected to 8 output pins on the PSoC, When switch 1 is on a test pattern will run on device 1, when 2 is on a pattern will run on device 2... etc. When multiple switches are on I want the pattern to run on multiple devices synchronously (I understand that they all cannot be turned on and off at the exact same time but can all be turned on within a few hundred milliseconds or so and off in the same). I pretty much have the code written now so that the pins are all read and put into a bitfield. I want a function to be able to read the bitfield and understand which switches (flags) are on and run the pattern on those specifed devices. I thought using a bitfield might be an easy way to accomplish this but now I'm stumped. If there is a simpler way besides using bitfields i would love to hear it. I thought about using switch statements but then I would need to write 255 switch statements based on all the combinations that the switches could be in, and that seems a little insane. There must be an easy way to do this since it seems like such a basic thing to do. I have attached my project
Show LessA quick question regarding the ADC SAR Component on the PSoC5:
I am using the ADC_SAR in single shot 8-bit mode to take a reading every 8mS. I am using the internal ISR of the ADC_SAR to detect the end of a conversion and read the value. If I am detecting EoC in this fashion, is the call to IsEndConversion() still required/recommended? It seems like it would be redundant, since when the ISR fires that alone would confirm that the conversion is done.
Thanks in advance for the clarification!
Show Less