Hey geeky folks, I am facing the issue in writing the values on RCC clock configuration register. Which would be more efficient? direct binary writings, using pointers, bit fields. I don't understand how to write on RCC register because just now I am getting started with arm and Keil. so kindly help me out, folks.
www2.keil.com/.../learn
http://www.keil.com/books/
http://www.keil.com/support/
Reference to RCC suggests you are using an STM32 ?
That's an ST product - unrelated to Keil.
So, for specific details about the STM32, you need to consult the ST documentation: http://www.st.com/stm32
yeah, I'm using STM32f427. thanks for your support, Mr. Andrew.
So your starting point for product-specific info is here:
www.st.com/.../stm32f427-437.html
Note the links at top-right to: Tools & Software Resources Support & Community
www.st.com/.../stm32-32-bit-arm-cortex-mcus.html
www.st.com/.../stm32-education.html
Cortex-M4 in general: The Definitive Guide to ARM® Cortex®-M3 and Cortex®-M4 Processors by Joseph Yiu www.amazon.com/.../ref=sr_1_1
>>Which would be more efficient?
A single load/store would be the most efficient.
For the optimizer to be able to work you'd need to load the content into a temporary variable (register) manipulate it there, and then store it back.
Typically, RCC is likely to be something that you'd set once at startup, and not change (much) during operation - so not much point spending time agonising about "efficiency" here.
ST - as other manufacturers - provides definitions to easily access their registers. Just use them.
Only if you have very specific requirements that really can't be met via the standard definitions provided should you start trying to micro-manage stuff like this.
As the old saying goes,
"Premature optimisation is a root of all kinds of evil"
wiki.c2.com/