This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Wait time for setting PLL: DM368

I have some question about setting PLL registers on DM368.
I use UBL included in flash-utils-03.21.00.04 packge.
An exception occurs in UBL when power up and down repeatedly.

I ckecked this, I can find out that An exception dose not occur when fixing some of PLL setting routine (DEVICE_PLL1 Init/DEVICE_PLL2Init) in UBL.

The correction are as follows.

1. add WAIT after setting PLL1->PREDIV
2. add WAIT after setting  PLL1->PLLCMD
3. add WAIT after checking status of SYSTEM->PLL0_CONFIG

PLL2 set in the same way.

I compared PLL setting routine in UBL to PLL setting routine in evmdm365.gel.
There's wait time in PLL setting routine (Setup_PLL1/Setup_PLL2) in evmdm365.gel.
It's different from PLL setting routine (DEVICE_PLL1 Init/DEVICE_PLL2Init) in UBL and PLL setting routine (Setup_PLL1/Setup_PLL2) in evmdm365.gel. Adding wait time process same as evmdm365.gel, An exception does not occurs.

source code and gel file the  I used is as follows.
device.c     : source code in flash-utils-03.21.00.04
evmdm365.gel : Gel file in CCSv5

I have some question
1. I'd like to know how long it need wait time after setting registers.
   There's no information about Gel file & wait time on User's Guide(sprufg5a.pdf).
   I don't think there's shortage of wait time.

2. Does it need _wait (100 ) on line 501 in evmdm365.gel?

3. Does it need _wait (2000 ) on line 518 in evmdm365.gel?

4. Does it need _wait (2000 ) on line 522 in evmdm365.gel?

5. There's _wait (150 ) on line 564 in evmdm365.gel.
   Does it need 150 counts ?
   ※ 50 counts in UBL.

  *pll_ctl &= ~0x0001;             // Set PLL in bypass
  _wait( 150 );

6. Does it need _wait (2000 ) on line 590 in evmdm365.gel?

  *pll_cmd |= 0x0001;              // Set GOSET
  while( ( *pll_stat & 1 ) != 0 ); // Wait until complete
  _wait( 2000 );


Please let me know.
Best regards,