cancel
Showing results for 
Search instead for 
Did you mean: 

Using CTU in SPC56EC74

Tim Tashpulatov
Associate II
Posted on November 10, 2017 at 08:56

Hi,

I want to use CTU in SPC56EC74 to trigger ADC conversions upon events generated by EMIOS Unified Channels running in OPWM mode. The ADC and EMIOS are configured and appear working, however CTU does not seem operational.

As far as I understand the CTU has to be enabled by setting appropriate bit in ME_PCTL57. Quoting the xpc56ec.h:

/* Note on PCTL registers: There are only some PCTL implemented in */

/* Bolero 3M. In order to make the PCTL easily addressable, these */

/* are defined as an array (ie ME.PCTL[x].R). This means you have */

/* to be careful when addressing these registers in order not to */

/* access a PCTL that is not implemented. Following are available: */

/* 104, 92, 91, 73, 72, 69, 68, 60, 57, 44, 33, 32, 24, 23, 21-16, 13-4*/

union { /* Peripheral Control 0..143 (+0x00C0-0x0128) */

vuint8_t R;

struct {

vuint8_t :1;

vuint8_t DBG_F:1;

vuint8_t LP_CFG:3;

vuint8_t RUN_CFG:3;

} B;

} PCTL[105];

, which apparently means that register 57 is available, and is the right register for the CTU, according to the datasheet:


_legacyfs_online_stmicro_images_0690X0000060MuwQAE.png

So I try enabling the CTU:

&sharpdefine SPC5_CTUL_START_PCTL (SPC5_ME_PCTL_RUN(1) | SPC5_ME_PCTL_LP(2))

SPCSetPeripheralClockMode (57, SPC5_CTUL_START_PCTL);

, but cannot verify the actual contents of ME_PCTL57 as there is no such register in SFR View. The SPCSetPeripheralClockMode() executes OK, however looking at the contents of ME_PS1 I can see that the CTU still is frozen:


_legacyfs_online_stmicro_images_0690X0000060MvVQAU.png

So my question is, what should be the proper way to enable CTU in SPC56EC74? Another question is why the ME_PCTL57 is not shown in the SFR View?

Regards

Tim

#spc56xx #ctu
2 REPLIES 2
Erwan YVIN
ST Employee
Posted on November 10, 2017 at 10:59

Hello Tim ,

Your configuration on the PCTL is correct.

Maybe you should configure the trigger source in CTU part.

for the PCTL57 not visible on PLS UDE. it is an PLS issue for SFR View.

there is a workaround by using the Watch view in casting the good pointer (cf screenshot)

0690X0000060PDBQA2.png

Best regards

Erwan

174921CGIL2