Welcome to Planetpsoc

Recovering from a Watchdog Reset

E-mail Print PDF
( 0 Votes )
Many times in applications using the Watchdog timer, there may be a requirement to detect if a reset occurred due to Watchdog or POR / XRES and the application may either start fresh in case of POR / XRES or recover and start executing from the state when the watchdog reset occurred.

DETECT THE SOURCE OF RESET

The first requirement is to find out the source of reset.  This can be done by checking the WDRS bit in the CPU_SCR0 register.  This bit is set in case of a watchdog reset event.  The below code in the beginning of main.c can be used.
if(CPU_SCR0 & CPU_SCR0_WDRS_MASK)
{
    // Reset is due to Watchdog
}
PRESERVE GLOBAL VARIABLES

In order to recover from a watchdog reset and resume the application, it is necessary that the Global variables be preserved when the watchdog reset occurs.  This can be done by setting the IRAMDIS bit in the CPU_SCR1 register.  When this bit is set, all the cells marked “??” in the below table are preserved during a Watchdog reset (taken from Technical Reference Manual Section 3).

Read more...
 

Setting UART Baud Rate in PSoC3

E-mail Print PDF
( 1 Vote )
Question: How do I set the Baud Rate of the UART component in PSoC3?

Answer: There are two ways to set the Baud Rate of the UART component.

Option-1: Using the Standard Baud Rates

When the "Internal Clock" option is enabled in the Advanced tab in the UART component configuration window, the UART configuration window has a drop down list with standard baud rates from 110bps to 921.6kbps.  The baud rate for the UART can be selected from this list.  When this option is used, the PSoC Creator automatically sets the Clock source for the UART component. The below figure shows the screen shot of Baud Rate selection using standard baud rates.
Read more...
 

Connecting a Multiple Wired Bus in PSoC Creator

E-mail Print PDF
( 2 Votes )

Many times we may want to connect a multiple wired hardware bus to another multiple wired bus, or a Status / Control register or to multiple GPIO pins. This video shows how to achieve multiple wire hardware bus connections in the Schematic Editor in PSoC Creator.

 


Page 2 of 22