cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC™ Creator & Designer

Anonymous
Not applicable

We share the same source code over several different PSoC devices (PSoC 3 and PSoC 5) and  use a varying amount of features. For some debug functions, I would like to test (precompiler - #ifdef) if in the current project a given resource is available. For instance, whether Port3 or Port 5 exists (on the package of course, I understand that the registers and hardware might be even there, just not externally connected), would be useful to a debugging tool that displays the status of each port.

   

cydevice.h and cypins.h define all the registers, I have checked also in designs that use a package where those pins don't exist.

   

I think the fitter must have a knowledge base for each device/package?

   

There is CYDEV_SRAM_SIZE and CYDEV_EE_SIZE, so for some resources the software can find the sizes.

   

But for instance,

   

CYDEV_IO_PC_PRT5_SIZE 0x00000008u

   

for a CY8C3866LTI-067, the 48 pin QFP package, that does not have port 5.

   

Andreas

0 Likes
4 Replies
Bob_Marlowe
Expert II

You could use something similar to

   

 

   

#ifdef CYDEV_PRT4_BASE

   

 

   

which will not be defined when port4 does not exist

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Unfortunately, this does not work,

   

as for instance for the mentioned device, CY8C2866LTI-067, port 3 does not exist (on the package),

   

but CYDEV_IO_PC_PRT3_BASE is defined,

   

I guess, you meant that when you wrote "CYDEV_PRT4_BASE"? 

   

I did not find CYDEV_PRT1_BASE, for instance in my project with the mentioned device.

   

It seems that preprocessor definitions are done on a architecture level (e.g. PSoC 3),

   

reflecting the content of the "PSoC x Register TRM" without incorporating the limits of the chosen device.

   

Andreas

0 Likes
Bob_Marlowe
Expert II

I was checking a PSoC4-file, sorry, so the name I gave is different for PSoC 3/5.

   

 

   

Too bad that the generated files do not exclude non-existing ports. I would suggest to file a "MyCase" on this matter, probably there is a way to find out.

   

 

   

Bob

0 Likes
ETRO_SSN583
Esteemed Contributor

To create a technical case at Cypress -

   

 

   

www.cypress.com

   

“Support”

   

“Technical Support”

   

“Create a Case”

   

 

   

You have to be registered on Cypress web site first.

   

 

   

Regards, Dana.

0 Likes