PSoC™ 5, 3 & 1 Forum Discussions
text.format{('custom.tabs.no.results')}
PSoC digital blocks can operate as 8-bit pulse width modulators (PWM). Due to the special design of the PSoC, these modules do not incorporate glitch-free hardware logic but instead logic must be considered in software.
As seen from the image below, the problem lies in the absense of hysterisis in the comparisons taking place to generate the digital output.
A workaround to this is presented in the following document: http://www.cypress.com/?rID=2801
Regards,
Arvind
Show LessMechanical keypads are commonly available in two forms – matrix and common bus (depending on how individual switches are inter connected) :
There are multiple ways in which you can use a PSoC 1 to read mechanical keypads.
Appnote AN2034 shows you how to read matrix and common bus keypads, in both polled and interrupt modes.
The document and example projects can be downloaded from this page: http://www.cypress.com/?rID=2824
Regards,
Arvind
Show Lesssir,
I am tring to add RTC module along with an ADC. I am counting and displaying only seconds up to 60 on the furst row of the LCD. I omitted to dispaly the minute,hour,day and other details.The thing works fine with debugger. But after programming the chip the RTC only works, adc is not working. whats my mistake?.I copied the codes used in the example projects.
***************************
main.c
****************************
#include
<device.h>
#include
"utils.h"#include
<stdio.h>void
{
RTC_TIME_DATE Start;
main() uint8 tmpVar = 0u; uint16 output; char OutputString[12]; /* Fill struct with date and time */
Start.Sec = 0u;
Start.Min = 0u;
Start.Hour = 0u;
Start.DayOfMonth = 1u;
Start.Month = 1u;
Start.Year = 2007u;
/* Enable all interrupts */
CyGlobalIntEnable;
/* Set date and time */
RTC_WriteTime(&Start);
/* Set alarm date and time */
RTC_WriteAlarmSecond(10u);
RTC_WriteAlarmMinute(0u);
RTC_WriteAlarmHour(0u);
RTC_WriteAlarmDayOfMonth(1u);
RTC_WriteAlarmMonth(1u);
RTC_WriteAlarmYear(2007u);
/* 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);
ADC_DelSig_1_Start();
ADC_DelSig_1_StartConvert();
/* 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);
{
while (1u) /* Make a 100 ms delay */
CyDelay(100);
#if (CY_PSOC3) /* Prepare clock tree configuration for low power mode entry */
CyPmSaveClocks();
* 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.
*******************************************************************/
/*******************************************************************RTC_DisableInt();
/* Entry Sleep low power mode */
CyPmSleep(PM_SLEEP_TIME_NONE, PM_SLEEP_SRC_ONE_PPS);
/* Restore clock tree configuration */
CyPmRestoreClocks();
* Enable RTC interrupt for ISR to be executed on restored clock
* frequency.
*******************************************************************/
/*******************************************************************LCD_Position(1, 0);
LCD_PrintString(
output = ADC_DelSig_1_GetResult16();
sprintf(OutputString,
LCD_Position(1, 0);
LCD_PrintString(OutputString);
LCD_Position(1, 8);
LCD_PrintInt16(output);
RTC_EnableInt();
" " ); "%u" , output); #endif /* (CY_PSOC3) */
}
}
*********************************
RTC_int.c
**********************************
void
{
RTC_EverySecondHandler(void)/* Place your every second handler code here. */
/* `#START EVERY_SECOND_HANDLER_CODE` */
/* Get and print current seconds */
temp = RTC_ReadSecond();
PrintDecNumber(temp, 0u, 11u);
/* Get status */
temp = RTC_ReadStatus();
/* Get and print active alarm status */
{
RTC_Stop();
Start.Sec = 0u;
Start.Min = 0u;
Start.Hour = 0u;
Start.DayOfMonth = 1u;
Start.Month = 1u;
Start.Year = 2007u;
RTC_WriteTime(&Start);
RTC_WriteAlarmSecond(0u);
RTC_WriteAlarmMinute(1u);
RTC_WriteAlarmHour(0u);
RTC_WriteAlarmDayOfMonth(1u);
RTC_WriteAlarmMonth(1u);
RTC_WriteAlarmYear(2007u);
RTC_Start();
temp = RTC_ReadMinute();
PrintDecNumber(temp, 0u, 8u);
LCD_Position(1u, 15u);
LCD_PutChar(
}
if (RTC_STATUS_AA & temp) 'A');else
{
LCD_Position(1u, 15u);
LCD_PutChar(
}
' ');/* `#END` */
}
/*******************************************************************************
* Function Name: RTC_EveryMinuteHandler
********************************************************************************
*
* Summary:
* This function is called every minute.
*
* Parameters:
* None.
*
* Return:
* None.
*
*******************************************************************************/
void
{
RTC_EveryMinuteHandler(void)/* Place your every minute handler code here. */
/* `#START EVERY_MINUTE_HANDLER_CODE` */
/* Get and print current minutes */
temp = RTC_ReadMinute();
PrintDecNumber(temp, 0u, 8u);
/* `#END` */
}
Show LessHello ALL
I looked through the entire cypress website for SPI bootloader, but the attempt was futile...
Do any one has created SPI bootloader or is there any info on how to create SPI bootloader...
Show Less There was a requirement to write assembly code for PSoC5 project and since the compiler is ARM GCC the inline assemblty code goes as below
asm( "mov r0, r0\n\t" "mov r0, r0\n\t" "mov r0, r0\n\t" "mov r0, r0" );
The above assembly code is just 4 NOP. For single NOP it will look likeShow Lessasm( "mov r0, r0"); I know its hard to learn assembly. So if you need to write assembly instructions, do these steps- Install Notepad++ Write a code in C Build the project In the generated files go to directory Cortex- M3->ARM_GCC_441->Debug Open main.lst using Notepad++- here you can see how each C code is made up of assembly instructions You can optimise the code and replace the C code with asembly