This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

LM3S6918

i am working with LM3S6918 controller .i need to enable port D pin as input and make changes .I am not able to understand how to do it?

  • Hi,

    - download and read the programming manual
    - enable Clocks for Peripheral GPIO-D in APB2ENR (I think it's names SYSCTRL on LMI)
    - enable GPIO-D in GPIO Registers
    - set Data Direction to INPUT in GPIO Registers
    - read from GPIO data register

    Do not forget to wait a while between Peri Clock Enable and the first peripheral Reg. write. If the wait loop is too short and you write to the peripheral before it's Clock is stable you will run into a hard fault (it's a good idea to set a BP there to detect this problem).

    BR,
    /th.

  • i have enable clock for peripheral GPIO-D register.By default all pins are inputs.After that if i change the input pin to 0/1 i am getting oxof.