PSoC™ 5, 3 & 1 Forum Discussions
My recent PSoc5 design spends most of its time asleep waking up by the 4o96 ms sleep timer looking to see whether it's time to do something or go back to sleep. So it could be awake for a few seconds occassionally throughout the day.
However, I need to add a heartbeat flashing led. Is there a clock I can use which does not go to sleep?
The design was developed on the CY8CKIT-059 prototyping kit and the target board uses the same PSoc device
Dafydd
Show LessHi,
We connect the digital Input pin to a digital component.
Of course, this digital input cannot be set to "High impedance analog" on the Pin component's configure screen.
However, this digital input pin can be changed to "High impedance analog" with the API of SetDriveMode(Pin_DM_ALG_HIZ).
When I tried using CY8CKIT-059,
It seems that it has been successfully changed to high impedance analog.
/* Hardware */
/* Software */
#include "project.h"
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
PWM_Start();
/*************************************************/
Pin_SetDriveMode(PIN_DM_ALG_HIZ);
Disable the above API:
LED blinks(Enable PWM) when SW is not pressed
LED turns(Disable PWM) off when SW is pressed
Enable the above API: LED turns off
/*************************************************/
for(;;)
{
}
}
Can this usage cause problems?
Do we need to change the description to ”Pin_DM_DIG_HIZ"?
Regards,
Show LessSo I'm working on some bootloaders,and I'd like to know how I can pull the chip's SiliconID and SiliconRev(to check the validity of the incoming bootloadable with respect to the chip.)
I dug through some code and found some registers that seem to be holding these values.
if(CYSWAP_ENDIAN32(CYDEV_CHIP_JTAG_ID)==siliconID && CYDEV_CHIP_REV_EXPECT==siliconRev){
//Okay,lets carry on.
}else{
//Sorry,something aint right.
}
So I have 2 questions:
1.Will this code do what I want it to?..or have I misunderstood it?
2.Where is the register map for PSoC3? I didnt seem to find it in the TRM.
PSoC Rocks.
Regards,
kmmankad
Show LessI like to use the USBUART example as a base for my project. I only need the USB connection. I would prefer HID but as I am a nebe on PSOC I thought to start with the USB UART example removing LCD and UART part using only USB receive/transmit. In the past I did so when starting with a (for me) unkown uC family / vendor.
Unfortunately this does not work. deleting LCD interface in TopDesign and the generated sources for UART and LCD the generated source is rebuild when generating the application. How is the procedure for using example for a base for a design... getting rid of all parts that are not needed by the new design. is there a book avaliable where I can find more information ? I already whatched some presentation on youtube. I worked with microchhip devices in the past and I now I have to use PSOC and it is not so easy for me for I cannot control phereiperals directly...
Show LessI have some questions about comparator bypass mode and I marked the sentence that I don't understand.
1. Is it mean "the output is neither synchronized with bus clock on rising edge nor synchronized to the bus clock on falling edge" or "the output is not synchronized with bus clock on rising edge but it synchronized to the bus clock on falling edge"?
2. What is that mean reset comparator output?Why reset it?
Show Less
I have created a small FreeRTOS project that can be expanded.
Project status:
1) CY8CKit-059 targeted
2) Uses 32K RAM (can be changed)
3) Uses Micro-USB as a USB-Uart.
4) Uses the Finger Stick Debugger USB-Uart port (if not broken off), otherwise uses UART to pins 12[6],12[7]
5) Starts flashing blue User LED when powered on.
6) Easily debugged using PSOC Creator.
Enjoy!
Show LessI have a CY8CKIT-059 PSoC 5LP prototyping kit, and I am trying to have my Rasberry PI 3b+ send data through an I2C connection to the PSoC to adjust the PWM of the onboard LED on the PSoC. I am able to send an increase, decrease, and clear command to the PSoC, but when I try to read the data from the PSoC, I am no longer able to send commands. Note: I am using an EZI2C component.
Here is my PSoC code:
#include "project.h"
uint8 I2Cbuffer[128];
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
uint8 PWMValue = 0;
I2C_Start();
PWM_Start();
I2C_SetBuffer1(128, sizeof(I2Cbuffer), I2Cbuffer);
/* Place your initialization/startup code here (e.g. MyInst_Start()) */
while(1)
{
if(I2C_curStatus == I2C_STATUS_WRITE1 )
{
I2C_GetActivity(); //Clears the flag
if (I2Cbuffer[0] == 0x46)
{
PWMValue = PWMValue + 10;
}
else if (I2Cbuffer[0] == 0x52)
{
PWMValue = PWMValue - 10;
}
else if (I2Cbuffer[0] == 0x5A)
{
PWMValue = 0;
}
I2Cbuffer[8] = PWMValue; //subaddress I will look for the data
PWM_WriteCompare(PWMValue);
}
}
}
/* [] END OF FILE */
My python code through the Raspberry PI uses smbus to send data to address 8, sub-address 0. I then read data from address: 8, sub-address: 8. For read commands I print the read data to the console.
My PSoC code was generated using PSoC creator 4.3.
I'm fairly new to the PSoC devices, any idea where there might be a fault?
Show LessHi everyone,
Help me regarding psoc 5lp interfacing with i2c expander ic 23017.
Here I post my code but didnot work,
This is One way I tried,
#define I2C_SLAVE_ADDRESS (0x27) // 5v at A0 A1 A2
packet[0] = 0x01;
packet[1] = 0x00;
packet[2] = 0x13;
uint8 packet[3];
uint8 packet_Size = 3;
void main()
{
I2C_Start();
UART_1_Start(); /* Enabling the UART */ UART_1_PutString("\nStart\n\r");
uint8_t status = I2C_MasterWriteBuf(I2C_SLAVE_ADDRESS,(uint8 *)&packet,packet_Size,I2C_MODE_COMPLETE_XFER);
sprintf(cmd,"status %d\r\n",status);
UART_1_PutString(cmd);
while(0 == (I2C_MasterStatus() & I2C_MSTAT_WR_CMPLT)){
}
if(0 == (I2C_MSTAT_ERR_XFER & I2C_MasterStatus()))
{
I2C_MasterWriteByte(3); //value send Which bit or GPIO set on IC 23017
UART_1_PutString("write done\n\r");
}
}
_________________________________________________________________________________________
2nd way I tried,
#define I2C_SLAVE_ADDRESS (0x27) // 5v at A0 A1 A2
void main()
{
I2C_Start();
I2C_MasterSendStart(I2C_SLAVE_ADDRESS, I2C_WRITE_XFER_MODE); //I2C_WRITE_XFER_MODE (0x00u) /* Write */
I2C_MasterWriteByte(0x01); // IODIRB register
I2C_MasterWriteByte(0x00); // set all of port B to outputs
I2C_MasterWriteByte(0x13); // address port B
I2C_MasterWriteByte(0x03); // value send Which bit or GPIO set on IC 23017
I2C_MasterSendStop();
}
___________________________________________________________________________________________________
I want to set gpio one by one .Status is 0 it is ok. But did not set the GPIO of the IC.
Show LessHi all,
I am just now trying to learn how to use the Verilog functionality of PSoC. I just had one question, if I made a component and write Verilog code for it; lets say I want to read the output of the component on the main loop in C, hw would I set the component so that I could read it by a command such as component_Read() for example.
Show Less