SPRUII0F May 2019 – June 2024 TMS320F28384D , TMS320F28384D-Q1 , TMS320F28384S , TMS320F28384S-Q1 , TMS320F28386D , TMS320F28386D-Q1 , TMS320F28386S , TMS320F28386S-Q1 , TMS320F28388D , TMS320F28388S
In this mode, the signal is first synchronized to the system clock (SYSCLKOUT) and then qualified by a specified number of cycles before the input is allowed to change. Figure 15-2 and Figure 15-3 show how the input qualification is performed to eliminate unwanted noise. Two parameters are specified by the user for this type of qualification: 1) the sampling period, or how often the signal is sampled, and 2) the number of samples to be taken.
Time between samples (sampling period):
To qualify the signal, the input signal is sampled at a regular period. The sampling period is specified by the user and determines the time duration between samples, or how often the signal is sampled, relative to the CPU clock (SYSCLKOUT).
The sampling period is specified by the qualification period (QUALPRDn) bits in the GPxCTRL register. The sampling period is configurable in groups of 8 input signals. For example, GPIO0 to GPIO7 use GPACTRL[QUALPRD0] setting and GPIO8 to GPIO15 use GPACTRL[QUALPRD1]. Table 15-2 and Table 15-3 show the relationship between the sampling period or sampling frequency and the GPxCTRL[QUALPRDn] setting.
Sampling Period | ||
---|---|---|
If GPxCTRL[QUALPRDn] = 0 | 1 × TSYSCLKOUT | |
If GPxCTRL[QUALPRDn] ≠ 0 | 2 × GPxCTRL[QUALPRDn] × TSYSCLKOUT | |
Where TSYSCLKOUT is the period in time of SYSCLKOUT |
Sampling Frequency | ||
---|---|---|
If GPxCTRL[QUALPRDn] = 0 | fSYSCLKOUT | |
If GPxCTRL[QUALPRDn] ≠ 0 | fSYSCLKOUT × 1 ÷ (2 × GPxCTRL[QUALPRDn]) | |
Where fSYSCLKOUT is the frequency of SYSCLKOUT |
From these equations, the minimum and maximum time between samples can be calculated for a given SYSCLKOUT frequency:
Example: Maximum Sampling Frequency: |
---|
If GPxCTRL[QUALPRDn] = 0 |
then the sampling frequency is fSYSCLKOUT |
If, for example, fSYSCLKOUT = 60MHz |
then the signal is sampled at 60MHz or one sample every 16.67ns. |
Example: Minimum Sampling Frequency: |
---|
If GPxCTRL[QUALPRDn] = 0xFF (255) |
then the sampling frequency is fSYSCLKOUT × 1 ÷ (2 × GPxCTRL[QUALPRDn]) |
If, for example, fSYSCLKOUT = 60MHz |
then the signal is sampled at 60MHz × 1 ÷ (2 × 255) (117.647kHz) or one sample every 8.5μs. |
Number of samples:
The number of times the signal is sampled is either three samples or six samples as specified in the qualification selection (GPAQSEL1, GPAQSEL2, GPBQSEL1, and GPBQSEL2) registers. When three or six consecutive cycles are the same, then the input change is passed through to the device.
Total Sampling-Window Width:
The sampling window is the time during which the input signal is sampled as shown in Figure 15-3. By using the equation for the sampling period, along with the number of samples to be taken, the total width of the window can be determined.
For the input qualifier to detect a change in the input, the level of the signal must be stable for the duration of the sampling-window width or longer.
The number of sampling periods within the window is always one less than the number of samples taken. For a three-sample window, the sampling-window width is two sampling-periods wide where the sampling period is defined in Table 15-2. Likewise, for a six-sample window, the sampling-window width is five sampling-periods wide. Table 15-4 and Table 15-5 show the calculations used to determine the total sampling-window width based on GPxCTRL[QUALPRDn] and the number of samples taken.
Total Sampling-Window Width | ||
---|---|---|
If GPxCTRL[QUALPRDn] = 0 | 2 × TSYSCLKOUT | |
If GPxCTRL[QUALPRDn] ≠ 0 | 2 × 2 × GPxCTRL[QUALPRDn] × TSYSCLKOUT | |
Where TSYSCLKOUT is the period in time of SYSCLKOUT |
Total Sampling-Window Width | ||
---|---|---|
If GPxCTRL[QUALPRDn] = 0 | 5 × TSYSCLKOUT | |
If GPxCTRL[QUALPRDn] ≠ 0 | 5 × 2 × GPxCTRL[QUALPRDn] × TSYSCLKOUT | |
Where TSYSCLKOUT is the period in time of SYSCLKOUT |
The required duration for an input signal to be stable for the qualification logic to detect a change is described in the data sheet.
Example Qualification Window:
For the example shown in Figure 15-3, the input qualification has been configured as follows:
This configuration results in the following:
tw(IQSW) = 5 × tw(SP) = 5 × 2 × GPxCTRL[QUALPRDn] × TSYSCLKOUT = 5 × 2 × TSYSCLKOUT
Sampling period, tw(SP) = 2 x TSYSCLKOUT = 2 x 16.67ns = 33.3ns
Sampling window, tw(IQSW) = 5 × tw(SP) = 5 × 33.3ns = 166.7ns
tw(IQSW) + tw(SP) + TSYSCLKOUT = 166.7ns + 33.3ns + 16.67ns = 216.7ns