PSoC™ 5, 3 & 1 Forum Discussions
Hi All,
I recently had the benifit to learn about Power Line Communication, it sounds like it could be a good way to improve power efficency to a older home. Check out this video and app note http://www.cypress.com/?rID=40641 it shows how you can use exsisting power lines in your house to control anything connected to that line.
They will be coming out with a PSoC 5 solution early next year, should be interesting.
Thanks,
Jeff
Show LessI implemented a proximity sensor using PSoC5. A proximity range of 17cm was achieved with a circular loop conductor (thickness=1mm, radius=10cm). Anyone got a better range ?
Show LessPSoC Creator 2.0 will be available soon and it brings some exciting new features. You can now configure the Pins component to show an annotation terminal. This is a new type of connection for off-chip components. Complementing the new feature is a comprehensive library of annotation components, such as resistors, capacitors, diodes, and power supplies. Use these components to document your PSoC schematics with the board-based features of your design. We’re already using annotation components in our Application Notes and Code Examples on the web. Look for the new content in the Component Catalog !
Show LessI implemented a proximity sensor using PSoC3. A proximity range of 17cm was achieved with a circular loop conductor (thickness=1mm, radius=10cm). Anyone got a better range ?
Show LessMany 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 table 3-4 of Technical reference manual (SRAM Map Post SWBootReset (00h)) are preserved during a Watchdog reset.
Add the below code in the beginning of main.c to preserve the content of these RAM locations.
CPU_SRC1 |= CPU_SCR1_IRAMDIS;
There are a few more points to consider in the usage of the IRAMDIS bit.
· When using C as the programming language, the boot.asm sets all the global variables to 0x00. This has to be disabled. The boot.asm has a constant “C_LANGUAGE_SUPPORT”, in the beginning. Set this constant to 0 to disable the global initialization. Change the value of the constant in boot.tpl in the project folder, save boot.tpl and Generate Application. As “boot.asm” is generated from boot.tpl, the change will now reflect in boot.asm.
· Only RAM locations from 0x03 are preserved when IRAMDIS is set. Locations 0x00, 0x01 and 0x02 will still get reset. So, no global variable should be placed in these locations. This is highly unlikely to happen though. By default all the global variables are placed in the area “bss”, which follows the areas “virtual_registers” (used by the compiler to store virtual registers) and “InterruptRAM” (used for user module variables). These areas will mostly occupy the locations 0x00 to 0x02 and more. In the remote possibility that both these areas are empty and “bss” starts from 0x00, you will have to create a custom area and place it at a location above 0x02, and place all the locals in this area. More details about placing globals in the desired RAM location can be found in this KB article. The location of the RAM areas can be checked in the project map file (with .mp extension) in the “output” folder in the project.
· Only RAM Page-0 gets cleared by resets and need be preserved by IRAMDIS bit. In devices with more than 256 bytes of RAM, Page-1 and above are not changed by a watchdog reset. So, locating all the global variables in RAM Page-1 or above will not require setting the IRAMDIS bit.
ADDING SOME MORE RELIABILITY
What if the event that caused the watchdog reset (RF interference or a power supply spike), also corrupted some of the global variables? We need to be able to detect this and start the program normally. Create a checksum of all the global variables that are critical to the program and store it in another variable. Every time one of the global variables is updated, update the checksum as well. On watchdog reset, calculate the checksum of all the global variables and compare it with the checksum variable. If the calculated value matches the stored value, then the global variables are intact and the process may proceed to recover from the last state. If the checksum values do not match, then the process can start from beginning.
The code in the beginning of main.c will look something like this:
CPU_SRC1 |= CPU_SCR1_IRAMDIS; // Set the IRAMDIS bit
if(CPU_SCR0 & CPU_SCR0_WDRS_MASK) // Check the source of reset
{
Reset is due to Watchdog.
Calculate the checksum of the global variables.
If Checksum matches:
Resume from the last state
Else
Start application from beginning
}
else
{
Reset is due to POR / XRES. Start the application from beginning
}
CLEARING THE WATCHDOG TIMER
Some basic guidelines about when to clear the watchdog timer:
1. Watchdog timer should be cleared in the main code.
2. Watchdog timer must never be cleared in an ISR.
3. It should be cleared as less as possible.
4. Timeout duration must be set by considering the worst case execution time of the loop.
Show LessWe have updated the programming specifications for PSoC 3 available at www.cypress.com/. We have added the full details on SWD interface timing diagrams, and updated the JTAG programming hardware requirements. This updated document will be helpful for any one developing PSoC 3 programming solutions or wanting to know about programmer hardware requirement for their PSoC 3 board.
Show LessPSoC1 devices can be acquired for programming using two methods:
1. Toggling the Vdd to the device
2. Applying XRES to the device
Power Cycle programming mode toggles the power to the device to acquire it. Thus, this should be used when the device is not powered externally. MiniProg should be able to apply Vcc to the device in this case.
In reset programming mode, MiniProg uses the XRES line to acquire the device. The device should be powered externally while using this mode. Also, this mode cannot be used with devices which do not have XRES pin.
Show LessHi,
does any body have a app notes or project for I2C <-> RS-485 bridge?
I need to use the smallest size I can get for this like 8 pin PSOC1.
thanks
Guy
Show LessThis article will go through the points to be taken care while implementing precision temperature measurement system using these sensors. Temperature sensing involves selection of right sensors as well as necessary signal conditioning and digitization in order to efficiently and accurately measure the temperature. Before we go to the temperature measurement system, let's examine the advantages and disadvantages of each of the commonly-used temperature sensor.
Continue reading on EE Times.
Show Less