AnsweredAssumed Answered

ls1021 FTM chain configuration and HW signal synchronization

Question asked by Luc Roy on Mar 3, 2016
Latest reply on Mar 9, 2016 by Serguei Podiatchev

1- I am trying to understand how FTM chaining works, synchronisation between FTM. In particular,  I do not understand the following sentence from the reference manual:

 

Connecting CH7 output of FlexTimer-B to PHA input of FlexTimer-A.

 

It refers to connecting channel 7 of FlexTimer-B (FTM5-8). Unfortunately, FTM5-8 only have CH0,1. So, is there a problem with the documentation?

 

2- I would like to reset the FTM counter to the CNTIN value via hardware FTM7_CH1 on the ls1021aiot target board. Relating the hardware signal to the trigger event is not clear.  So far, the coding of this feature was unsuccessful. However, I was able to get C1V to change according to the FTM7_CH1.

 

MY_FLEX_TIMER_SETBIT_4 (ftmVirtAddr[DEV_TO_USE], FSL_LS1021A_OFFSET_FTM_SYNCONF,

      FSL_LS1021A_VALUE_SYNCONF_RW_SYNCMODE | FSL_LS1021A_VALUE_SYNCONF_RW_HWRSTCNT | FSL_LS1021A_VALUE_SYNCONF_RW_HWRWBUF | FSL_LS1021A_VALUE_SYNCONF_RW_HWTRIGMODE);

MY_FLEX_TIMER_SETBIT_4 (ftmVirtAddr[DEV_TO_USE], FSL_LS1021A_OFFSET_FTM_SYNC, FSL_LS1021A_VALUE_SYNC_RW_TRIG1);

 

here is the state of the registers after the code runs:

 

 

  0 Status And Control             (FTM_SC       ), Ptr:0x22051000, Value:0x48000000 PS=0 Clks=01 TOE=1

  4 Counter                        (FTM_CNT      ), Ptr:0x22051004, Value:0x4b340000 X

  8 Modulo                         (FTM_MOD      ), Ptr:0x22051008, Value:0x983a0000 15000

12 Channel (n) Status And Control (FTM_C0SC     ), Ptr:0x2205100c, Value:0x28000000 MSnB, ELSnB

16 Channel (n) Value              (FTM_C0V      ), Ptr:0x22051010, Value:0x4c1d0000 X

20 Channel (n) Status And Control (FTM_C1SC     ), Ptr:0x22051014, Value:0x44000000 CHIE, ELSnA

24 Channel (n) Value              (FTM_C1V      ), Ptr:0x22051018, Value:0xb4360000 X

28 Channel (n) Status And Control (FTM_C2SC     ), Ptr:0x2205101c, Value:0x00000000

32 Channel (n) Value              (FTM_C2V      ), Ptr:0x22051020, Value:0x00000000

36 Channel (n) Status And Control (FTM_C3SC     ), Ptr:0x22051024, Value:0x00000000

40 Channel (n) Value              (FTM_C3V      ), Ptr:0x22051028, Value:0x00000000

44 Channel (n) Status And Control (FTM_C4SC     ), Ptr:0x2205102c, Value:0x00000000

48 Channel (n) Value              (FTM_C4V      ), Ptr:0x22051030, Value:0x00000000

52 Channel (n) Status And Control (FTM_C5SC     ), Ptr:0x22051034, Value:0x00000000

56 Channel (n) Value              (FTM_C5V      ), Ptr:0x22051038, Value:0x00000000

60 Channel (n) Status And Control (FTM_C6SC     ), Ptr:0x2205103c, Value:0x00000000

64 Channel (n) Value              (FTM_C6V      ), Ptr:0x22051040, Value:0x00000000

68 Channel (n) Status And Control (FTM_C7SC     ), Ptr:0x22051044, Value:0x00000000

72 Channel (n) Value              (FTM_C7V      ), Ptr:0x22051048, Value:0x00000000

76 Counter Initial Value          (FTM_CNTIN    ), Ptr:0x2205104c, Value:0x00000000

80 Capture And Compare Status     (FTM_STATUS   ), Ptr:0x22051050, Value:0x01000000 CH0F

84 Features Mode Selection        (FTM_MODE     ), Ptr:0x22051054, Value:0x05000000 WPDIS FTMEN

88 Synchronization                (FTM_SYNC     ), Ptr:0x22051058, Value:0x71000000 TRIG0 TRIG1 TRIG2 CNTMIN

92 Initial State Channels Output  (FTM_OUTINIT  ), Ptr:0x2205105c, Value:0x00000000

96 Output Mask                    (FTM_OUTMASK  ), Ptr:0x22051060, Value:0x00000000

100 Function For Linked Channels   (FTM_COMBINE  ), Ptr:0x22051064, Value:0x00000000

104 Deadtime Insertion Control     (FTM_DEADTIME ), Ptr:0x22051068, Value:0x00000000

108 FTM External Trigger           (FTM_EXTTRIG  ), Ptr:0x2205106c, Value:0x00000000

112 Channels Polarity              (FTM_POL      ), Ptr:0x22051070, Value:0x00000000

116 Fault Mode Status              (FTM_FMS      ), Ptr:0x22051074, Value:0x00000000

120 Input Capture Filter Control   (FTM_FILTER   ), Ptr:0x22051078, Value:0x00000000

124 Fault Control                  (FTM_FLTCTRL  ), Ptr:0x2205107c, Value:0x00000000

128 Quadrature Decoder Ctrl&Status (FTM_QDCTRL   ), Ptr:0x22051080, Value:0x00000000

132 Configuration                  (FTM_CONF     ), Ptr:0x22051084, Value:0x00000000

136 FTM Fault Input Polarity       (FTM_FLTPOL   ), Ptr:0x22051088, Value:0x00000000

140 Synchronization Configuration  (FTM_SYNCONF  ), Ptr:0x2205108c, Value:0x81000300 SYNCMODE HWTRIGMODE HWRSTCNT HWWRBUF

144 FTM Inverting Control          (FTM_INVCTRL  ), Ptr:0x22051090, Value:0x00000000

148 FTM Software Output Control    (FTM_SWOCTRL  ), Ptr:0x22051094, Value:0x00000000

152 FTM PWM Load                   (FTM_PWMLOAD  ), Ptr:0x22051098, Value:0x00000000

 

Is there an application note for the ls1021 flex timer or processor family?

 

Thank you

Outcomes