Em_EEPROM_v2_20 not working with ExtClk

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

cross mob
JoSt_1074751
Level 2
Level 2
Welcome!

I Need ExtClk (24MHz 10ppm) to clock the TCPWM_P4_v2_10 capture unit.

But the Em_EEPROM_v2_20 is not working when I use ExtClk for HFClk.

If I use IMO (24MHz 2%) for HFClk it works! But I have no acurate capture.

Any Ideas how to get both modules working?

Device is CY8C4025AZI-S413

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello Joachim,

For 4000S device you must keep the Timer operation and the execution of CySysFlashWriteRow function exclusive to each other. This is because the API cannot be implemented without the use of IMO.

If possible you can try using other device like PSOC 4200 (CY8C4245AXI-483). This device has a UDB based Timer( as shown in the attached figure). The Timer can be provided an external clock using a digital input pin (to provide higher accuracy) while the system can run on IMO. This will keep the working of the Timer operation and Flash Write independent of each other.

Regards

Ekta

View solution in original post

0 Likes
9 Replies
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello

Please refer to the following thread which addresses the same issue:

External clock for a timer

It is not possible to use ExtClk as input to a fixed function block until that clock is used as device clock.

1. Use the UDB implementation of the the PWM. In that case you any of the GPIO as the input to the component. The external clock can be given through that pin. You may have to the the firmware code with correct API's.

2. You can also use a WCO crystal and use it to trim IMO (24MHz) to increase the accuracy as shown in the figure below:

pastedImage_2.png

3. Use the external clock as input to the whole system. If you don't want a lower(24MHz) clock to run the system, use a 48 MHz external source,finally in the clock component you can select HFCLK and divider value to get the frequency you require.

Ensure that you select Clock type as 'New' in the clock component configurator.

Best Regards

Ekta

0 Likes

1) I found no UDB in the CY8C4025AZI-S413 (not in Datasheets or Creator4.2)

2) Trim gives me only 0.2% but I need 0.0030% accuracy.

3) External Clock is not working with Em_EEPROM-Device.

more ideas ?

0 Likes
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello Joachim,

I tried building a project using TCPWM_P4_v2_10 and Em_EEPROM_v2_20 component.  I took ExtClk (24MHz) as source of HFClk and used it as input to TCPWM as mentioned in step 3. I was able to Build the project without any error. The clock settings that I made are shown below:

pastedImage_0.png

Can you please share your project or the error that you are getting while trying to use ExtClk so that I can look into it.

Best Regards

Ekta

0 Likes

Hi Ekta,

Yes, there is no compilation error shown.

Have you tried writing to the Em_Eeprom?

My processor hooks up as soon as I write to the Em_Eeprom 😞

Best Regards

Joachim

0 Likes

I found this ….

/*******************************************************************************

* Function Name: CySysFlashWriteRow

****************************************************************************//**

*

* Erases a row of Flash and programs it with the new data.

*

* The IMO must be enabled before calling this function. The operation of the

* flash writing hardware is dependent on the IMO.

*

* For PSoC 4000, PSoC 4100 BLE and PSoC 4200 BLE devices (PSoC 4100 BLE and

* PSoC 4200 BLE devices with 256K of Flash memory are not affected), this API

* will automatically modify the clock settings for the device. Writing to

* flash requires that changes be made to the IMO and HFCLK settings. The

* configuration is restored before returning. This will impact the operation

* of most of the hardware in the device.

*

0 Likes
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello Joachim

Yes I too found the same thing in the definition of CysysFlashWriteRow function.

The CysysFlashWriteRow API erases a row of Flash and programs it with the new data. This function is IMO dependent.

While writing the data to the flash changes are made in the IMO and HFCLK settings. The configuration is restored before returning.

Thus, this will impact the operation of most of the hardware in the device.

Thus, if you want to use TCPWM component with ExtClk you can write the firmware such that the TCPWM component is not used when CysysFlashWriteRow is being executed.

Can you please let me for what purpose are you using the TCPWM component ?

Best Regards

Ekta

0 Likes
lock attach
Attachments are accessible only for community members.

Hello Ekta,

I am using the TCPWM component to measure the period of an input signal (F_OPTO).

So I capture the timer-value at the rising edges of the signal.

The period is the difference of two captured-values.

Accuracy of clock3 should be 30ppm.

(i.e. It would be very helpful to have a Timer that can be clocked with a Pin…)

Best Regards

Joachim

Von: EktaN_26 <community-manager@cypress.com>

Gesendet: Freitag, 2. August 2019 13:46

An: Stölker, Joachim <stoelker@rheintacho.de>

Betreff: Re: – Em_EEPROM_v2_20 not working with ExtClk

Cypress Developer Community <https://community.cypress.com/?et=watches.email.thread>

Em_EEPROM_v2_20 not working with ExtClk

Antwort von EktaN_26<https://community.cypress.com/people/EktaN_26?et=watches.email.thread> in PSoC 4 MCU Community - Komplette Diskussion anzeigen<https://community.cypress.com/message/204711?et=watches.email.thread#204711>

0 Likes
lock attach
Attachments are accessible only for community members.
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello Joachim,

For 4000S device you must keep the Timer operation and the execution of CySysFlashWriteRow function exclusive to each other. This is because the API cannot be implemented without the use of IMO.

If possible you can try using other device like PSOC 4200 (CY8C4245AXI-483). This device has a UDB based Timer( as shown in the attached figure). The Timer can be provided an external clock using a digital input pin (to provide higher accuracy) while the system can run on IMO. This will keep the working of the Timer operation and Flash Write independent of each other.

Regards

Ekta

0 Likes

Hello Ekta,

Thank you very much for your suggestions. I think I have to switch off the Capture-Timer during Flash-Write.

I had a look at the great features of the PSOC 4200 but I guess our accounting department would not be much amused about such a big change ☹

Best Regards

Joachim

Von: EktaN_26 <community-manager@cypress.com>

Gesendet: Montag, 5. August 2019 09:09

An: Stölker, Joachim <stoelker@rheintacho.de>

Betreff: Re: – Em_EEPROM_v2_20 not working with ExtClk

Cypress Developer Community <https://community.cypress.com/?et=watches.email.thread>

Em_EEPROM_v2_20 not working with ExtClk

Antwort von EktaN_26<https://community.cypress.com/people/EktaN_26?et=watches.email.thread> in PSoC 4 MCU Community - Komplette Diskussion anzeigen<https://community.cypress.com/message/204857?et=watches.email.thread#204857>

0 Likes