PSoC™ 5, 3 & 1 Forum Discussions
Hi,
I have some hardware processes the raises some interrupts. The software part must wait for all interrupts completed. But I have no knowledge about the numer of events.
Is there a way to check for still pending interrupts. I only found functions to clear the queue.
Bye
Franz
Show LessI'm working with the CY8CKIT-059 5LP Prototyping Kit. I added a PWM in FF mode to my project and connect the output to the onboard Blue LED on P2.1. The PWM controls the LED as expected but when I'm done running the PWM I issue a PWM_Stop() followed by a LED_B_Write(0) (which LED_B is defined and connected to P2.1).
I would expect that after those 2 commands the LED would be OFF but it is ON.
I'm not attaching my project as I thought this would be a general question with perhaps something else I need to do to fully disconnect the PWM from the Blue LED. Reading the datasheet of the PWM it reads as though the stop state would be to have PWM at a 0 but perhaps I'm missing something.
Thanks,
George
Show LessI added CyPmSleep () to my program with reference to the sleep timer sample code.
But did not wakeup.
As a result of investigating the cause, it was found that DieTemp_Start () does not wake up
Executing DieTemp_Stop () had no effect
I want to measure die temperature and sleep
Is there a solution
device:CY8C5888LTI-LP097
PSoC Creator 4.2
DieTemp Ver.2.1
SleepTimer Ver3.2
I'm sorry.I am inconvenient in English.
Show LessGeneral item. Have used the Eval Board off and on to set up a quick test of an actual product we make.
Really can't beat the price.
Then sometimes it sort of gets out hand being used for official test stations.
Wonder if that has happened to others also?
Built about 50 of these, hopefully, that will last the product.
Mike Simons
Show LessHello PSOC community,
I've attached a bare bones dual application combination projects that I made. It represents the basic setting for my real project and demos the errors that I'm getting.
The issue is when I try to jump into my second application it just jumps back to the first application. There isn't much code but I'll layout the two main.c that are causing the issue.
This is main.c for the bootloader
#include "project.h"
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
/* Place your initialization/startup code here (e.g. MyInst_Start()) */
uint32_t status = Bootloader_1_GetMetadata(Bootloader_1_GET_BTLDB_STATUS, Bootloader_1_MD_BTLDB_ACTIVE_1);
if (status == 1u)
Bootloader_1_Exit(Bootloader_1_EXIT_TO_BTLDB_2);
Bootloader_1_Start();
for(;;)
{
/* Place your application code here. */
}
}
basically I check to see if it going to load the second application and the explicitly exit to the second application
This is main.c for AppA the first application
// App A
#include "project.h"
#define PRESSED (1u)
#define WAITING (0u)
volatile uint8_t button1_pressed = WAITING;
CY_ISR(button1ISR)
{
button1_pressed = PRESSED;
}
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
/* Place your initialization/startup code here (e.g. MyInst_Start()) */
isr_button1_StartEx(button1ISR);
for(;;)
{
LED1_Write(0xffu);
CyDelay(100);
LED1_Write(0u);
CyDelay(100);
if (button1_pressed == PRESSED)
{
CyDelay(3000);
Bootloadable_1_SetActiveApplication(Bootloadable_1_MD_BTLDB_ACTIVE_1);
Bootloadable_1_Load();
}
}
}
Here I wait for a button to be pressed, then Set the active application to AppB and exit to the bootloader.
I've debugged to code and followed the Load actually loads the main.c bootloader code then exits back AppA instead of AppB.
I'm not sure what I'm doing wrong. I'm using a PSOC 5LP. Attached is the Workspace that contains the three projects Bootloader, AppA, and AppB.
Oh just for reference here is AppB's main.c
// App B
#include "project.h"
#define PRESSED (1u)
#define WAITING (0u)
volatile uint8_t button1_pressed = WAITING;
CY_ISR(button1ISR)
{
button1_pressed = PRESSED;
}
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
/* Place your initialization/startup code here (e.g. MyInst_Start()) */
isr_button1_StartEx(button1ISR);
for(;;)
{
LED1_Write(0xffu);
CyDelay(1000);
LED1_Write(0u);
CyDelay(1000);
if (button1_pressed == PRESSED)
{
Bootloadable_1_SetActiveApplication(Bootloadable_1_MD_BTLDB_ACTIVE_0);
Bootloadable_1_Load();
}
}
}
Thanks for any help,
-Morio
Show LessHi all,
I have a question about bootloader interfaces. In my current project I want to be able to load over either UART or USB HID interfaces. I would probably determine the interface in the application, save a value with this choice in NVM, then read it in the bootloader and use the specified interface. It looks like through "normal" means this isn't really possible, however it looks like I could possibly use the functions from their respective UART_Boot.c/USBFS_Boot.c files, choosing which communications functions to use based on the selection made in the application. In simple form, I'm thinking something like this:
static cystatus Bootloader_WritePacket(uint8 status, uint8 buffer[], uint16 size) CYSMALL \
{
uint16 CYDATA checksum;
/* Start of packet. */
/*These indeces may also need changing depending on interface?*/
buffer[Bootloader_SOP_ADDR] = Bootloader_SOP;
buffer[Bootloader_CMD_ADDR] = status;
buffer[Bootloader_SIZE_ADDR] = LO8(size);
buffer[Bootloader_SIZE_ADDR + 1u] = HI8(size);
/* Compute checksum. */
checksum = Bootloader_CalcPacketChecksum(buffer, size + Bootloader_DATA_ADDR);
buffer[Bootloader_CHK_ADDR(size)] = LO8(checksum);
buffer[Bootloader_CHK_ADDR(1u + size)] = HI8(checksum);
buffer[Bootloader_EOP_ADDR(size)] = Bootloader_EOP;
/* Start packet transmit. */
/*Bootl_HID would be read from NVM upon entering bootloader*/
if (Bootl_HID){
return(USBFS_CyBtldrCommWrite(buffer, size + Bootloader_MIN_PKT_SIZE, &size, 150u));
} else {
return(PC_UART_CyBtldrCommWrite(buffer, size + Bootloader_MIN_PKT_SIZE, &size, 150u));
}
}
Some tweaking would obviously be needed, determining if things like the addresses in the buffer will need to change, and making sure #ifdefs aren't removing stuff I would need for both interfaces, but I feel like this would be doable.
However surely there's a reason why we aren't just given the option to do this out of the box, so I'm curious as to what that might be. Basically, is there a good reason why I SHOULDN'T try something like this? Is it just a case of it would be too difficult to automatically generate code to use two or more arbitrary interfaces so it's not gui-configurable?
Thanks in advance for the tips!
Show LessHi,
We have a question about IMO of PSoC5LP.
PSoC5LP Datasheet URL
https://www.cypress.com/file/45926/download
The following specifications are listed on page 112 of the data sheet.
----------------------------------------
IMO Startup time: max 13 us
----------------------------------------
(1)
Is this 13us time from the start of IMO until it stabilizes?
(2)
Is it necessary to stabilize 13us even when switching from 24MHz (USB mode) to 24MHz (non USB mode)?
In low power consumption mode, USB is not used.
Switching clocks only when USB is required.
Therefore, I would like to confirm this spec.
Regards,
Show LessI development a firmware, with the Psoc 5, that it need to received data from the I2C when is in sleep. I have a problem, that casually the device resets. In the loop i execute only sleep function and i clear the Wdt. Inside of the loop i don't use the functions to receive from the i2c though the master send me the same the data through the i2c. if I unplug the cable manually, that i use for the i2c communication, the firmware does not reset. I have configured the I2C module in this mode:
Datarate:100kbps
Slave address:0x23
Implementation: fixed function
Address decode:hardware
Pins:I2C1
And this is the sleep function:
void Sleep ( void )
{
// Stop Global Interrupt
CYGlobalIntDisable ;
Enable_3_3V_Write ( OFF ) ;
PSoCBlockOFF ( ) ;
InOutOFF ( ) ;
Custom_Delay ( TIME_1_MS ) ;
// Sleep and wait for PICU interrupt
CyPmSaveClocks ( ) ;
// Mi risveglio con il timer o quando ricevo dati dall'I2C
CyPmSleep ( PM_SLEEP_TIME_NONE , PM_ALT_ACT_SRC_CTW | PM_SLEEP_SRC_I2C ) ;
CyPmRestoreClocks ( ) ;
InOutON ( ) ;
PSoCBlockON ( ) ;
update_Global_Time_from_sleep ( ) ;
Enable_3_3V_Write ( ON ) ;
// Start Global Interrupt
CYGlobalIntEnable ;
// Aggiorno il watchdog
CyWdtClear ( ) ;
}
I have urgency to resolve the problem. Can you help me ?
Show LessHi, so we are seeing a board-to-board variation on the ideal value for the Vdac for the Voltage Reference Source for the Capsense CSD component, ver 3.50. Is there some way in software to change this value? The settings are as follows:
Current Source: IDAC Sourcing
IDAC range: 255 uA
Number of bleed resistors: 1
Digital resource implementation: UDB Timer
Voltage reference source:
(*) Vdac 130 (2.08 V) --------> This value needs to be difference for different boards due to unit-to-unit variation.
Is there some software API or register to write to that can change this value?
Thanks!
-Michael Shonle
Show Less