Welcome to Planetpsoc

Finding Resource Usage in a PSoC3 / PSoC5 Project

E-mail Print PDF
( 1 Vote )
Question: How do I find out the resource usage in a PSoC3 or PSoC5 project?

Answer: The % of resources used in the PSoC3 or PSoC5 design may be found in the .rpt file in the Results tab of the Workspace Explorer. 

Tags: PSoC3 PSoC5
 

Placing a Constant Variable or Function in an Absolute Flash Address

E-mail Print PDF
( 0 Votes )
Questions:
1. I would like to place a constant variable in an absolute address in Flash.  I will place information like version and serial number in this absolute address. How do I do this?
2. I would like to place a function in an absolute address in Flash.  How do I do this?

Answer:  You can place either a constant variable or a function in absolute address in flash using the #pragma abs_address directive.

For example, to place constant variables in absolute address 0x3FC0:
#pragma abs_address 0x3FC0
const BYTE Version = 0x01;  // This byte is placed in address 0x3FC0
const char SerialNumber[] = "1234567890";  // This string is placed from address 0x3FC1
#pragma end_abs_address

To place a function "MyFunction" at address 0x1000, the same approach may be used.
#pragma abs_address 0x1000
void MyFunction(void)
{
    // Function code here
}
#pragma end_abs_address
 

Placing RAM Variable in an Absolute Address

E-mail Print PDF
( 0 Votes )
Question: How do I place a RAM variable in an absolute RAM address?

Answer: A RAM variable may be placed in an absolute RAM address using three methods.

Option-A: Using the #pragma directive

Let us say, we need to allocate a variable ‘myByte’ at an address 0x78 in RAM and another variable ‘myByte1’ at address 0x104 , then the process would be:
Read more...
 


Page 6 of 22