PRESETCTRL

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PRESETCTRL

866 Views
berndsirozynski
Contributor III

Hello,

i am using the LPC1347.

There is a register named PRESETCTRL.

With this register i can reset the Hardware from SSP0, I2C and SSP1.

To Reset the Hardware i must clear then coresponding bit to "0"

To activate the peripheral i must set the bit to "1"

Question: Is there a minimum time limit, between reset and set to this bit,

so the Hardware can do the internal reset operation ?

Reset the Bit

delay(xxx)

Set the Bit

wait until ready ???

after doing the reset, do i need to wait until Hardware is ready ???

very thanks for information

Bernd

Labels (1)
0 Kudos
3 Replies

581 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Bernd Sirozynski,

    The datasheet didn't give out the minimum, so I think you don't need to care about this time.

    You also don't need to add the delay to wait the hardware reset is ready.

    I have checked the official lpcopen code, take spi as an example, the peripheral reset code is wrote like this:

STATIC INLINE void Chip_SYSCTL_PeriphReset(CHIP_SYSCTL_PERIPH_RESET_T periph)
{
    Chip_SYSCTL_AssertPeriphReset(periph);
    Chip_SYSCTL_DeassertPeriphReset(periph);
}

void Chip_SSP_Init(LPC_SSP_T *pSSP)
{
    Chip_Clock_EnablePeriphClock(Chip_SSP_GetClockIndex(pSSP));
    Chip_SSP_SetSSPClkDivider(pSSP, 1);
    Chip_SYSCTL_PeriphReset(Chip_SSP_GetResetIndex(pSSP));

    Chip_SSP_Set_Mode(pSSP, SSP_MODE_MASTER);
    Chip_SSP_SetFormat(pSSP, SSP_BITS_8, SSP_FRAMEFORMAT_SPI, SSP_CLOCK_CPHA0_CPOL0);
    Chip_SSP_SetBitRate(pSSP, 100000);
}

STATIC INLINE void Chip_SYSCTL_AssertPeriphReset(CHIP_SYSCTL_PERIPH_RESET_T periph)
{
    LPC_SYSCTL->PRESETCTRL &= ~(1 << (uint32_t) periph);
}

STATIC INLINE void Chip_SYSCTL_DeassertPeriphReset(CHIP_SYSCTL_PERIPH_RESET_T periph)
{
    LPC_SYSCTL->PRESETCTRL |= (1 << (uint32_t) periph);
}

You can find no delay and wait, so just write the code like the official code.

Wish it helps you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

581 Views
berndsirozynski
Contributor III

Oh whats that ?
have i forgot to thank you kerry ????
Sorry, that is not my style.
Have very thanks for your good information.
and i wish a you a nice Christmas.

Bernd

0 Kudos

581 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Bernd,

   It doesn't matter, thanks for your updated information.

   Merry Christmas to you! :smileyhappy:

Have a great day,
Kerry

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos