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.

Direct register access model

Im using ccs compiler,I want to access direct register without sing inbuilt function.

here I have done initialization for  PB3 as input .

Is this the way to acces dirrect registers.

HWREG(GPIO_PORTB_BASE + GPIO_O_DIR)= ~GPIO_PIN_3; //PB3 input
HWREG(GPIO_PORTB_BASE + GPIO_O_AFSEL)=~(GPIO_PIN_3);//PB3 GPIO
HWREG(GPIO_PORTB_BASE+GPIO_O_DEN)=GPIO_PIN_3;//PB3 as digital

  • Hi nandhini,

    Do you have anything about using libraries? It makes it much more easy to program and other to give you support. Most of the times you can do everything without using direct register access. Especially initializations! Only criticaly fast code should be programmed in direct register.

    Yes that is the way to access direct registers. Now, are you correctly configuring PB3? Yes.
    I normally write my code in Tivaware and when I need it "to go faster" I go check the source files and the datasheet for how to do the same task with register access. It helps a lot since what's in the Tivaware functions is something that already works quite well so why go make it from scratch and most likely make mistakes (which is very easy in direct register access, there's no control)
  • Hello VJ,

    This is not DRM but close enough. However "word-of-advise" (Luis has already mentioned that on the forum), use TivaWare instead of DRM/Macros.

    Regards
    Amit