Part Number: TMS320F28379D
Other Parts Discussed in Thread: LAUNCHXL-F28379D, C2000WARE
Hi Professionals,
I am studying how to play with the TI C2000 MCU with the TI CCS platform. Right now I am using the "LAUNCHXL-F28379D".
When I was digging the steps of the blinkyled example of TI's, I tried my best to understand every function it called but I encountered one that I don't understand, which is what the title mentioned: “DEVICE_DELAY_US(x)”.
By opening the declaration it refers to, I can see that “DEVICE_DELAY_US(x)” is:
#define DEVICE_DELAY_US(x) SysCtl_delay( ( ( ((long double)(x)) / (1000000.0L / (long double)DEVICE_SYSCLK_FREQ) ) - 9.0L) / 5.0L).
Using the LAUNCHXL-F28379D I have, the above-mentioned equation would be:
(200x - 9) / 5 --> number of cycles used in SysCtl_delay; cycles is the number of OSCCLK cycles
I checked that "DEVICE_SYSCLK_FREQ" is 2e8 so the equation above should be solid. As for the OSCCLK cycles, what I understand is that it refers to the external crystal of the board, which is 10MHz, aka the time period of the cycle would be 1/10MHz=1e-7s per cycle.
Let's say x is 5e6. By the meaning of the function “DEVICE_DELAY_US(x)”, I should get around a 5s delay. Indeed the LED in the "LAUNCHXL-F28379D" board reacts accordingly, aka every 5s. However, according to the equation I show above, you will get:
(200x - 9) / 5 ~= 2e8 cycles --> time period of 2e8 cycles would be 2e8*1e-7 = 20s.
20s V.S 5s. That's a big difference! So I am asking is there anything I misunderstood?