Change Auto Generated Code

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

cross mob
Anonymous
Not applicable

Hello, I need to change the auto generated code in psoc 4.0

   

 

   

For a Project we use WCO as a clock source, LFCLK. The file cyfitter_cfg.c is an auto generated file from Psoc 4. after starting WCO component, a 500ms wait is performed till WCO should be stable. After the wait, a Low Power Option of WCO is set.

   

Goal of our application is, the Cyble 022001-00 is mainly in hibernation mode. After an Interrupt(from NFC chip) it programs a NFC Tag with the BLE address. A Smartphone reds the address, connects to BLE and retrieve information.

   

One of the main goals of our application is low power.  So current implementation takes 500+ms till the NFC tag is written and the Smartphone tries to connect. Manley the delay of the wait function after starting WCO. For writing the NFC Tag no WCO related function is needed.

   

My plan is to delete the wait cycle and set the low power option of WCO manually in my source code. For this I need an option how to change out generated source files. If there are any drawbacks to my plan please let me know.

   

It would be interesting to know the max time till WCO is stable, haven't found a hint of it in user manual and data sheet.

   

Thanks

   

@Bob sorry but my last posting is closed, but solved for me. To answer your last question I live near Karslruhe.

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

I cannot recommend tinkering around in the generated files. In the case a build is required the files will get overwritten. In case of Creator updates you are lost.

   

The delay is surely not taken just as 500ms, it is taken from the specs of the WCO. Would be a bit bad when the WCO doesn't start...

   

It takes 500ms starting the WCO at high power. You can do that in your program after reset when you like. Start WCO manually.  Refer to AN95089.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hello Bob and thanks for your answer. I understand fully the problems about changes in generated files and that the delay is not just a guess from someone. I have read AN95089 where the WCO is explained.

   

If I can't change the generated files, it seems to mee, that my only option is to activate ILO as startup source, start WCO manually and disable ILO after 500ms so that WCO is the only clock source. As recommended in AN95089 with external WCO.

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

Yes, I fully agree to that.

   

 

   

Bob

0 Likes