PSoC™ 4 Forum Discussions
Hi,
I was wondering if anyone knows if there is a way to battery back up the time for the PSOC 4 RTC component coming out in Creator 3.2 without backing up the whole processor? If not, what is the point of the component other than a timer that counts in days, months, etc? I am just wondering if this component in any way means I don't need my trusty old DS1307 any more.
Thank you,
Tom
Hi, I'm using the PSoC 4 CY8CKIT-049 and trying to get the fastest SW pin toggle.
I set all the clocks to the maximum of 48MHz, and set TestPin to P0[2].
then, I toggled the pin using
for(;;)
{
TestPin_DR |= TestPin_MASK;
TestPin_DR &= ~IndexPin_MASK;
}
However, i only get a 1.337 MHz square wave, which means the pin is being toggled at 2 * 1.337 MHz.
Why is there such a discrepancy with the 48MHz speed? Shouldn't it only take two cycles to toggle a pin in this method? Would there be anyway to do it faster using asm?
Thanks so much!
Show LessI just received the new CYBLE-022001-00 module and I wanted to try a project example. PRoC_BLE_CapSense_Slider_LED. It will not rebuild in PSOC 3.2
Rebuild Started: 04/21/2015 14:12:56 Project: PRoC_BLE_CapSense_Slider_LED, Configuration: ARM GCC 4.8.4 Debug ---------------
Info: scc.M0014: PSoC Creator needs permission to perform the "Make Writable" action. Do you wish to allow this on the files:
C:\Users\Bob\Documents\Cypress Projects\newblemod\PRoC_BLE_CapSense_Slider_LED\PRoC_BLE_CapSense_Slider_LED.cydsn\PRoC_BLE_CapSense_Slider_LED.cyprj
YES
cydsfit.exe -.appdatapath "C:\Users\Bob\AppData\Local\Cypress Semiconductor\PSoC Creator\3.2" -.fdsnotice -.fdswarpdepfile=warp_dependencies.txt -.fdselabdepfile=elab_dependencies.txt -.fdsbldfile=generated_files.txt -p "C:\Users\Bob\Documents\Cypress Projects\newblemod\PRoC_BLE_CapSense_Slider_LED\PRoC_BLE_CapSense_Slider_LED.cydsn\PRoC_BLE_CapSense_Slider_LED.cyprj" -d CYBLE-022001-00 -s "C:\Users\Bob\Documents\Cypress Projects\newblemod\PRoC_BLE_CapSense_Slider_LED\PRoC_BLE_CapSense_Slider_LED.cydsn\Generated_Source\PSoC4" -- -yv2 -q10 -ygs -o2 -v3 -.fftcfgtype=LE
Elaborating Design...
cmod
source
source
source
source
source
HDL Generation ...
Synthesis ...
Place and Route ...
Tech mapping ...
Analog Placement ...
Analog Routing ...
Analog Code Generation ...
Digital Placement ...
Digital Routing ...
Bitstream Generation ...
Static timing analysis ...
API Generation ...
Dependency Generation ...
Clean Temporary Files ...
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/main.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\main.c -o .\CortexM0\ARM_GCC_484\Debug\main.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/RGB_PRSm.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\RGB_PRSm.c -o .\CortexM0\ARM_GCC_484\Debug\RGB_PRSm.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/BLEApplications.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\BLEApplications.c -o .\CortexM0\ARM_GCC_484\Debug\BLEApplications.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/HandleLowPower.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\HandleLowPower.c -o .\CortexM0\ARM_GCC_484\Debug\HandleLowPower.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/cyfitter_cfg.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\cyfitter_cfg.c -o .\CortexM0\ARM_GCC_484\Debug\cyfitter_cfg.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/cymetadata.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\cymetadata.c -o .\CortexM0\ARM_GCC_484\Debug\cymetadata.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/CapSense.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\CapSense.c -o .\CortexM0\ARM_GCC_484\Debug\CapSense.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/CapSense_PM.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\CapSense_PM.c -o .\CortexM0\ARM_GCC_484\Debug\CapSense_PM.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/CapSense_CSHL.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\CapSense_CSHL.c -o .\CortexM0\ARM_GCC_484\Debug\CapSense_CSHL.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/CapSense_INT.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\CapSense_INT.c -o .\CortexM0\ARM_GCC_484\Debug\CapSense_INT.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/CapSense_TunerHelper.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\CapSense_TunerHelper.c -o .\CortexM0\ARM_GCC_484\Debug\CapSense_TunerHelper.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/CapSense_SMS.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\CapSense_SMS.c -o .\CortexM0\ARM_GCC_484\Debug\CapSense_SMS.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/BLE.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\BLE.c -o .\CortexM0\ARM_GCC_484\Debug\BLE.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/BLE_gatt.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\BLE_gatt.c -o .\CortexM0\ARM_GCC_484\Debug\BLE_gatt.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/BLE_eventHandler.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\BLE_eventHandler.c -o .\CortexM0\ARM_GCC_484\Debug\BLE_eventHandler.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/BLE_HAL_INT.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\BLE_HAL_INT.c -o .\CortexM0\ARM_GCC_484\Debug\BLE_HAL_INT.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/BLE_HAL_PVT.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\BLE_HAL_PVT.c -o .\CortexM0\ARM_GCC_484\Debug\BLE_HAL_PVT.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/BLE_custom.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\BLE_custom.c -o .\CortexM0\ARM_GCC_484\Debug\BLE_custom.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/User_Button.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\User_Button.c -o .\CortexM0\ARM_GCC_484\Debug\User_Button.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/RGB_PRSm_Blue.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\RGB_PRSm_Blue.c -o .\CortexM0\ARM_GCC_484\Debug\RGB_PRSm_Blue.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/RGB_PRSm_Green.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\RGB_PRSm_Green.c -o .\CortexM0\ARM_GCC_484\Debug\RGB_PRSm_Green.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/RGB_PRSm_Red.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\RGB_PRSm_Red.c -o .\CortexM0\ARM_GCC_484\Debug\RGB_PRSm_Red.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/isr_user_button.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\isr_user_button.c -o .\CortexM0\ARM_GCC_484\Debug\isr_user_button.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/CapSense_SampleClk.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\CapSense_SampleClk.c -o .\CortexM0\ARM_GCC_484\Debug\CapSense_SampleClk.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/CapSense_SenseClk.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\CapSense_SenseClk.c -o .\CortexM0\ARM_GCC_484\Debug\CapSense_SenseClk.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/BLE_bless_isr.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\BLE_bless_isr.c -o .\CortexM0\ARM_GCC_484\Debug\BLE_bless_isr.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/Cm0Start.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\Cm0Start.c -o .\CortexM0\ARM_GCC_484\Debug\Cm0Start.o
arm-none-eabi-as.exe -mcpu=cortex-m0 -mthumb -I. -IGenerated_Source\PSoC4 -alh=.\CortexM0\ARM_GCC_484\Debug/CyBootAsmGnu.lst -g -W -o .\CortexM0\ARM_GCC_484\Debug\CyBootAsmGnu.o .\Generated_Source\PSoC4\CyBootAsmGnu.s
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/CyFlash.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\CyFlash.c -o .\CortexM0\ARM_GCC_484\Debug\CyFlash.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/CyLib.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\CyLib.c -o .\CortexM0\ARM_GCC_484\Debug\CyLib.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/cyPm.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\cyPm.c -o .\CortexM0\ARM_GCC_484\Debug\cyPm.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/cyutils.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\cyutils.c -o .\CortexM0\ARM_GCC_484\Debug\cyutils.o
arm-none-eabi-gcc.exe -mcpu=cortex-m0 -mthumb -Wno-main -I. -IGenerated_Source\PSoC4 -Wa,-alh=.\CortexM0\ARM_GCC_484\Debug/CyLFClk.lst -g -D DEBUG -Wall -ffunction-sections -O0 -c .\Generated_Source\PSoC4\CyLFClk.c -o .\CortexM0\ARM_GCC_484\Debug\CyLFClk.o
arm-none-eabi-ar.exe -rs .\CortexM0\ARM_GCC_484\Debug\PRoC_BLE_CapSense_Slider_LED.a .\CortexM0\ARM_GCC_484\Debug\cyfitter_cfg.o .\CortexM0\ARM_GCC_484\Debug\CapSense.o .\CortexM0\ARM_GCC_484\Debug\CapSense_PM.o .\CortexM0\ARM_GCC_484\Debug\CapSense_CSHL.o .\CortexM0\ARM_GCC_484\Debug\CapSense_INT.o .\CortexM0\ARM_GCC_484\Debug\CapSense_TunerHelper.o .\CortexM0\ARM_GCC_484\Debug\CapSense_SMS.o .\CortexM0\ARM_GCC_484\Debug\BLE.o .\CortexM0\ARM_GCC_484\Debug\BLE_gatt.o .\CortexM0\ARM_GCC_484\Debug\BLE_eventHandler.o .\CortexM0\ARM_GCC_484\Debug\BLE_HAL_INT.o .\CortexM0\ARM_GCC_484\Debug\BLE_HAL_PVT.o .\CortexM0\ARM_GCC_484\Debug\BLE_custom.o .\CortexM0\ARM_GCC_484\Debug\User_Button.o .\CortexM0\ARM_GCC_484\Debug\RGB_PRSm_Blue.o .\CortexM0\ARM_GCC_484\Debug\RGB_PRSm_Green.o .\CortexM0\ARM_GCC_484\Debug\RGB_PRSm_Red.o .\CortexM0\ARM_GCC_484\Debug\isr_user_button.o .\CortexM0\ARM_GCC_484\Debug\CapSense_SampleClk.o .\CortexM0\ARM_GCC_484\Debug\CapSense_SenseClk.o .\CortexM0\ARM_GCC_484\Debug\BLE_bless_isr.o .\CortexM0\ARM_GCC_484\Debug\CyBootAsmGnu.o .\CortexM0\ARM_GCC_484\Debug\CyFlash.o .\CortexM0\ARM_GCC_484\Debug\CyLib.o .\CortexM0\ARM_GCC_484\Debug\cyPm.o .\CortexM0\ARM_GCC_484\Debug\cyutils.o .\CortexM0\ARM_GCC_484\Debug\CyLFClk.o
arm-none-eabi-ar.exe: creating .\CortexM0\ARM_GCC_484\Debug\PRoC_BLE_CapSense_Slider_LED.a
arm-none-eabi-gcc.exe -Wl,--start-group -o .\CortexM0\ARM_GCC_484\Debug\PRoC_BLE_CapSense_Slider_LED.elf .\CortexM0\ARM_GCC_484\Debug\main.o .\CortexM0\ARM_GCC_484\Debug\RGB_PRSm.o .\CortexM0\ARM_GCC_484\Debug\BLEApplications.o .\CortexM0\ARM_GCC_484\Debug\HandleLowPower.o .\CortexM0\ARM_GCC_484\Debug\cymetadata.o .\CortexM0\ARM_GCC_484\Debug\Cm0Start.o .\CortexM0\ARM_GCC_484\Debug\PRoC_BLE_CapSense_Slider_LED.a "C:\Program Files (x86)\Cypress\PSoC Creator\3.2\PSoC Creator\psoc\content\cycomponentlibrary\CyComponentLibrary.cylib\BLE_v1_20\Library\gccCyBLEStack_BLE_SOC_PERIPHERAL.a" "C:\Program Files (x86)\Cypress\PSoC Creator\3.2\PSoC Creator\psoc\content\cycomponentlibrary\CyComponentLibrary.cylib\CapSense_CSD_P4_v2_20\PSoC4\Library\CapsenseP4Library_GCC.a" "C:\Program Files (x86)\Cypress\PSoC Creator\3.2\PSoC Creator\psoc\content\cycomponentlibrary\CyComponentLibrary.cylib\CortexM0\ARM_GCC_484\Debug\CyComponentLibrary.a" -mcpu=cortex-m0 -mthumb -g -ffunction-sections -O0 -Wl,-Map,.\CortexM0\ARM_GCC_484\Debug/PRoC_BLE_CapSense_Slider_LED.map -T Generated_Source\PSoC4\cm0gcc.ld -specs=nano.specs -Wl,--gc-sections -Wl,--end-group
--------------- Rebuild Failed: 04/21/2015 14:13:56 ---------------
Any one have any ideals as to what the issue is.
Hello
I have Psoc 4 KIt. recentally I have done LED, LCD based Project. Now I want to interface ds1307 with LCD. I looked example project. That’s based on Psoc 3. But I am using Psoc 4
I created design. Design consist of LCD and ds1307. I am attaching my project workspace. please inform me there is any mistake in design
I am having problem in programming. I saw program in example project. That program was written for Psoc 3.
#include <device.h>
#include "utils.h"
void main()
{
uint8 tmpVar = 0u;
RTC_TIME_DATE Start;
/* Fill struct with date and time */
Start.Sec = 55u;
Start.Min = 59u;
Start.Hour = 22u;
Start.DayOfMonth = 31u;
Start.Month = 12u;
Start.Year = 2007u;
/* Enable all interrupts */
CyGlobalIntEnable;
/* Set date and time */
RTC_WriteTime(&Start);
/* Set alarm date and time */
RTC_WriteAlarmSecond(5u);
RTC_WriteAlarmMinute(3u);
RTC_WriteAlarmHour(1u);
RTC_WriteAlarmDayOfMonth(1u);
RTC_WriteAlarmMonth(1u);
RTC_WriteAlarmYear(2008u);
/* Set alarm mask */
RTC_WriteAlarmMask(RTC_ALARM_SEC_MASK | RTC_ALARM_MIN_MASK |
RTC_ALARM_HOUR_MASK | RTC_ALARM_DAYOFMONTH_MASK |
RTC_ALARM_MONTH_MASK | RTC_ALARM_YEAR_MASK);
/* Set interval mask - handling of interrupt stubs of the RTC component */
RTC_WriteIntervalMask(RTC_INTERVAL_SEC_MASK | RTC_INTERVAL_MIN_MASK |
RTC_INTERVAL_HOUR_MASK | RTC_INTERVAL_DAY_MASK |
RTC_INTERVAL_WEEK_MASK | RTC_INTERVAL_MONTH_MASK |
RTC_INTERVAL_YEAR_MASK);
/* DST start configuration */
RTC_WriteDSTMode(RTC_DST_ENABLE | RTC_DST_FIXDATE);
RTC_WriteDSTStartHour(23u);
RTC_WriteDSTStartDayOfMonth(31u);
RTC_WriteDSTStartMonth(12u);
/* DST stop configuration */
RTC_WriteDSTStopHour(2u);
RTC_WriteDSTStopDayOfMonth(1u);
RTC_WriteDSTStopMonth(1u);
RTC_WriteDSTOffset(123u);
/* Start RTC */
RTC_Start();
/* Start LCD */
LCD_Start();
/* Prepare 0th column */
LCD_Position(0u, 0u);
LCD_PrintString("RTC : : ");
/* Print current time */
tmpVar = RTC_ReadSecond();
PrintDecNumber(tmpVar, 0u, 11u);
tmpVar = RTC_ReadMinute();
PrintDecNumber(tmpVar, 0u, 8u);
tmpVar = RTC_ReadHour();
PrintDecNumber(tmpVar, 0u, 5u);
/* Prepare 1st column */
LCD_Position(1u, 0u);
LCD_PrintString(" - - ");
/* Get and print day of month */
tmpVar = RTC_ReadDayOfMonth();
PrintDecNumber(tmpVar, 1u, 0u);
/* Get and print month */
tmpVar = RTC_ReadMonth();
PrintDecNumber(tmpVar, 1u, 3u);
/* Get and print year */
tmpVar = (uint8)(RTC_ReadYear() % 100u);
PrintDecNumber(tmpVar, 1u, 6u);
/* Get and print day of week */
tmpVar = RTC_currentTimeDate.DayOfWeek;
LCD_Position(1u, 9u);
LCD_PutChar(tmpVar + 0x30u);
/* Get status */
tmpVar = RTC_ReadStatus();
/* Get and print if year is leap */
if(RTC_STATUS_LY & tmpVar)
{
LCD_Position(1u, 11u);
LCD_PutChar('L');
}
else
{
LCD_Position(1u, 11u);
LCD_PutChar(' ');
}
/* Get and print daytime AM/PM */
if(RTC_STATUS_AM_PM & tmpVar)
{
LCD_Position(0u, 14u);
LCD_PrintString("PM");
}
else
{
LCD_Position(0u, 14u);
LCD_PrintString("AM");
}
/* Get and print DST status */
if (RTC_STATUS_DST & tmpVar)
{
LCD_Position(1u, 13u);
LCD_PutChar('D');
}
else
{
LCD_Position(1u, 13u);
LCD_PutChar(' ');
}
/* Get and print alarm status */
if (RTC_STATUS_AA & tmpVar)
{
LCD_Position(1u, 15u);
LCD_PutChar('A');
}
else
{
LCD_Position(1u, 15u);
LCD_PutChar(' ');
}
while(1u)
{
/* Make a 100 ms delay */
CyDelay(100);
/* Prepare clock tree configuration for low power mode entry */
CyPmSaveClocks();
#if(CY_PSOC3)
/*******************************************************************
* Disable RTC interrupt before entering Sleep mode. The device will
* wake up on one pulse-per-second event, but the ISR will be
* executed when RTC interrupts will be enabled, after the clocks
* configuration will be restores. Potentially, this will allow to
* execute RTC ISR quicker, as CyPmSaveClocks() function could
* decrease master clock frequency. For PSoC 5 architectures
* (PSoC 5LP device), an interrupt is required for the CPU to wake
* up, so interrupt is disabled for PSoC3 only.
*******************************************************************/
RTC_DisableInt();
#endif /* (CY_PSOC3) */
/* Entry Sleep low power mode */
CyPmSleep(PM_SLEEP_TIME_NONE, PM_SLEEP_SRC_ONE_PPS);
/* Restore clock tree configuration */
CyPmRestoreClocks();
#if(CY_PSOC3)
/*******************************************************************
* Enable RTC interrupt for ISR to be executed on restored clock
* frequency.
*******************************************************************/
RTC_EnableInt();
#endif /* (CY_PSOC3) */
}
}
/* [] END OF FILE */
Hi,
is it possible to wire the PSoC4BLE in a way, that the fixed Timer/Counters are running with LFCLK?
Background: I need a (really) low power timer running at 4096Hz with a compare unit which is interrupt capable.
My current efforts are always stuck, because PSoC Creator is telling me, that I have to use HFCLK as clock source, actually: "The component requires a clock from the clock block." So the question could be transformed to "how to put LFCLK into the clock block?"
Thanks
Hardy
Show LessHello
I have Psoc 4 KIt. recentally I have done LED, LCD based Project. Now I want to interface ds1307 with LCD. I looked example project. That’s based on Psoc 3. But I am using Psoc 4
I created design. Design consist of LCD and ds1307. I am attaching my project workspace. please inform me there is any mistake in design
I am having problem in programming. I saw program in example project. That program was written for Psoc 3.
#include <device.h>
#include "utils.h"
void main()
{
uint8 tmpVar = 0u;
RTC_TIME_DATE Start;
/* Fill struct with date and time */
Start.Sec = 55u;
Start.Min = 59u;
Start.Hour = 22u;
Start.DayOfMonth = 31u;
Start.Month = 12u;
Start.Year = 2007u;
/* Enable all interrupts */
CyGlobalIntEnable;
/* Set date and time */
RTC_WriteTime(&Start);
/* Set alarm date and time */
RTC_WriteAlarmSecond(5u);
RTC_WriteAlarmMinute(3u);
RTC_WriteAlarmHour(1u);
RTC_WriteAlarmDayOfMonth(1u);
RTC_WriteAlarmMonth(1u);
RTC_WriteAlarmYear(2008u);
/* Set alarm mask */
RTC_WriteAlarmMask(RTC_ALARM_SEC_MASK | RTC_ALARM_MIN_MASK |
RTC_ALARM_HOUR_MASK | RTC_ALARM_DAYOFMONTH_MASK |
RTC_ALARM_MONTH_MASK | RTC_ALARM_YEAR_MASK);
/* Set interval mask - handling of interrupt stubs of the RTC component */
RTC_WriteIntervalMask(RTC_INTERVAL_SEC_MASK | RTC_INTERVAL_MIN_MASK |
RTC_INTERVAL_HOUR_MASK | RTC_INTERVAL_DAY_MASK |
RTC_INTERVAL_WEEK_MASK | RTC_INTERVAL_MONTH_MASK |
RTC_INTERVAL_YEAR_MASK);
/* DST start configuration */
RTC_WriteDSTMode(RTC_DST_ENABLE | RTC_DST_FIXDATE);
RTC_WriteDSTStartHour(23u);
RTC_WriteDSTStartDayOfMonth(31u);
RTC_WriteDSTStartMonth(12u);
/* DST stop configuration */
RTC_WriteDSTStopHour(2u);
RTC_WriteDSTStopDayOfMonth(1u);
RTC_WriteDSTStopMonth(1u);
RTC_WriteDSTOffset(123u);
/* Start RTC */
RTC_Start();
/* Start LCD */
LCD_Start();
/* Prepare 0th column */
LCD_Position(0u, 0u);
LCD_PrintString("RTC : : ");
/* Print current time */
tmpVar = RTC_ReadSecond();
PrintDecNumber(tmpVar, 0u, 11u);
tmpVar = RTC_ReadMinute();
PrintDecNumber(tmpVar, 0u, 8u);
tmpVar = RTC_ReadHour();
PrintDecNumber(tmpVar, 0u, 5u);
/* Prepare 1st column */
LCD_Position(1u, 0u);
LCD_PrintString(" - - ");
/* Get and print day of month */
tmpVar = RTC_ReadDayOfMonth();
PrintDecNumber(tmpVar, 1u, 0u);
/* Get and print month */
tmpVar = RTC_ReadMonth();
PrintDecNumber(tmpVar, 1u, 3u);
/* Get and print year */
tmpVar = (uint8)(RTC_ReadYear() % 100u);
PrintDecNumber(tmpVar, 1u, 6u);
/* Get and print day of week */
tmpVar = RTC_currentTimeDate.DayOfWeek;
LCD_Position(1u, 9u);
LCD_PutChar(tmpVar + 0x30u);
/* Get status */
tmpVar = RTC_ReadStatus();
/* Get and print if year is leap */
if(RTC_STATUS_LY & tmpVar)
{
LCD_Position(1u, 11u);
LCD_PutChar('L');
}
else
{
LCD_Position(1u, 11u);
LCD_PutChar(' ');
}
/* Get and print daytime AM/PM */
if(RTC_STATUS_AM_PM & tmpVar)
{
LCD_Position(0u, 14u);
LCD_PrintString("PM");
}
else
{
LCD_Position(0u, 14u);
LCD_PrintString("AM");
}
/* Get and print DST status */
if (RTC_STATUS_DST & tmpVar)
{
LCD_Position(1u, 13u);
LCD_PutChar('D');
}
else
{
LCD_Position(1u, 13u);
LCD_PutChar(' ');
}
/* Get and print alarm status */
if (RTC_STATUS_AA & tmpVar)
{
LCD_Position(1u, 15u);
LCD_PutChar('A');
}
else
{
LCD_Position(1u, 15u);
LCD_PutChar(' ');
}
while(1u)
{
/* Make a 100 ms delay */
CyDelay(100);
/* Prepare clock tree configuration for low power mode entry */
CyPmSaveClocks();
#if(CY_PSOC3)
/*******************************************************************
* Disable RTC interrupt before entering Sleep mode. The device will
* wake up on one pulse-per-second event, but the ISR will be
* executed when RTC interrupts will be enabled, after the clocks
* configuration will be restores. Potentially, this will allow to
* execute RTC ISR quicker, as CyPmSaveClocks() function could
* decrease master clock frequency. For PSoC 5 architectures
* (PSoC 5LP device), an interrupt is required for the CPU to wake
* up, so interrupt is disabled for PSoC3 only.
*******************************************************************/
RTC_DisableInt();
#endif /* (CY_PSOC3) */
/* Entry Sleep low power mode */
CyPmSleep(PM_SLEEP_TIME_NONE, PM_SLEEP_SRC_ONE_PPS);
/* Restore clock tree configuration */
CyPmRestoreClocks();
#if(CY_PSOC3)
/*******************************************************************
* Enable RTC interrupt for ISR to be executed on restored clock
* frequency.
*******************************************************************/
RTC_EnableInt();
#endif /* (CY_PSOC3) */
}
}
/* [] END OF FILE */
In my design, the battery (the capacity is 50mAh) is always feed into the the pSoC4 BLE.
When an user touch the device, the pSoC4 BLE should power on the system(other chips etc.).
The pSoC 4 BLE's capsense is periodically(1sec via WDT) check the user's touch.
The Capsense Low Power Method is shown on page 64 http://www.cypress.com/?docID=50746 .
In this low power design, What is the current consumption ?
In my case, It must be needed under 5 uA.
Show LessHi all, I just purchased a Pioneer Kit, and started testing basic connection between the PSoC4 BLE and my laptop and phone.
The connection with the usb dongle was fine, and i could use the CapSense Slider of the board to see how the dongle's blue led glows and fade.
But when i try to connect the PSoC with my android phone, i cannot stablish a connection.
If I use the Android native bluetooth settings, i can see the PSoC as "BLE Slider and LED", but the connection get refused with the following warning: "Couldn’t pair with BLE Slider and LED because of an incorrect PIN or passkey."
So I decided to use the CySmart app, but still the same problem.
and finally I get the following error "Cannot connect to device"
What am I doing wrong? I'm using a BQ Aquaris E4.5 with Android 4.4.2 version, so bluetooth low energy should be supported by the system API.
Show Less