Use components from ISR - best practice

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
user_1570836
Level 4
Level 4
50 replies posted 25 replies posted 25 sign-ins
        Greetings, I have bought CY8CKIT-059 kit recently, its my first Cypress board. In a program, I need to access components defined in TopDesign.cysch from an ISR routine. I have defined a function (I don't remember in what .h file, the definition got deleted), placed its code to main.c file, and I am calling it from ISR defined in generated source file isr_updatereg.c . It is working how I need it, but as the function definition got deleted from .h file, I feel that I am violating some best-practice rules, or similar. How would you use components from ISR? I have attached related files in a ZIP archive.   
0 Likes
10 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Welcome in the forum!

   

As a general rule of thumb: Do not tamper the generated source files. Never.

   

When accessing a component, best practice is to use the APIs provided. Open the component's datasheet and see how they work.

   

When posting code, easiest is to post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

You may tell us a bit more about what you want to perform with your -59 Kit.

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
user_1570836
Level 4
Level 4
50 replies posted 25 replies posted 25 sign-ins

I am building RGB led cube. I have 74HC595 shift registers in driver circuit, connected to PSoC using SPI. And I want to periodically update the registers, approximately each 120us.

0 Likes
lock attach
Attachments are accessible only for community members.
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Look into project corrections

   

 

   

Bob

0 Likes
user_1570836
Level 4
Level 4
50 replies posted 25 replies posted 25 sign-ins

Thanks, I will look at it tomorrow.

0 Likes
user_1570836
Level 4
Level 4
50 replies posted 25 replies posted 25 sign-ins

I understand changes in main.c . However, in archive, you sent me, I can't open TopDesign.cysch . Did you change anything in that file?

   

Thanks for your help.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Probably you do not run the latest Creator version which is 3.3 CP1. I strongly recommend to update using Cypress Update Manager.

   

 

   

Bob

0 Likes
user_1570836
Level 4
Level 4
50 replies posted 25 replies posted 25 sign-ins

That's true, I had 3.1 . Now it opened TopDesign correctly. I haven't noticed any differences....so, did you change anything? Or you just changed main.c ?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I only changed main.c and have re-generated the sources.

   

 

   

Bob

0 Likes
user_1570836
Level 4
Level 4
50 replies posted 25 replies posted 25 sign-ins

OK, thanks for your help. How can I mark your post as verified answer?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Don't know how to flag, I ask questions here too seldomly,   😉

   

 

   

Bob

0 Likes