2016-01-16 05:19 AM
hello I am using STM32Nuleo103 and keil compiler.
I was configuring GPIOA->CRL register. I found followingGPIOA->CRL = oxooooooo8; //worksGPIOA->CRL |= oxooooooo8; //Not worksI am confused i am just doing ORing with the CRL register to avoid modifying other pins configuration. But i tried to do so, i found second assignment doesn't work but first work.How to avoid this?2016-01-16 06:06 AM
What does ''not work'' actually mean in this context? That it doesn't set bit 3 ?
There are TWO bits per GPIO in the register, you'd want to make sure both bits get where you want. If you want to write the bit pair 10 for PA1 GPIOA->CRL = (GPIOA->CRL & 0xFFFFFFF3) | 0x00000008;