lpcware

Reserved bits in LPC1317

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by aamir ali on Wed Jul 17 03:41:10 MST 2013
Some of registers says that user should not write 1 to this bit & reading this bit is undefined.

But there are registers like "PDRUNCFG", which says that user should only write 1 for some of its bits. But user manual doesn't say that reading bit is undefined. So does that mean reading this bit is defined always & will return '1'

So which one is correct way of writing to register, suppose I have turn on ADc module:

1. LPC_SYSCON->PDRUNCFG &= ~(1UL<<4);    /* Disable Power down bit to the ADC block. */


2. uint32_t temp;
   temp = LPC_SYSCON->PDRUNCFG & 0x000005FF;   /* mask out reserved bits */
   temp = temp & (~(1UL << 4))                 /* turn on ADC module bit */
   LPC_SYSCON->PDRUNCFG  = temp | 0x0000E800;  /* set bits which need to be high always */

Outcomes