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

polling in LPC2378

Hi!! I am a newbie to ARM7 microcontrollers, and i am going to work on the LPC2378. I have read a little bit on programming th microcontroller, and i can now comfortably flash LEDs. But, now i want to write a program that uses polling in LPC2378, such that when a particular input pin goes high, some function should be executed. Can anyone please help me out, coz i dont know how to read inputs in LPC2378(i know this is pretty dumb...but i am a total novice).
Please let me know how one can read inputs from port pins ,using polling method, assuming my input device is a push button, and how can i possibly simulate this on Keil uVision3.

Parents
  • Just a quick question: Have you downloaded the user manual for the processor? Have you looked at it? If you haven't, then I recommend that you spend a couple of hours with this document before we continue with this thread.

    The manual is huge and may seem scary, but it is in free-standing chapters so you don't have to read everything.

    But there are three important chapters in it:
    - Pin Configuration
    - Pin connect block
    - General Purpose Input/Output ports (GPIO)

    Since you already know how to flash a LED, you already know how to set a GPIO signal as input or output. And you know how to write to the port.

    By reading the third of my suggested chapters, it should quickly follow how to read from a GPIO pin.

    Polling is nothing fancier than to read from a pin, make a dceision. Do something. Then repeat the loop again.

Reply
  • Just a quick question: Have you downloaded the user manual for the processor? Have you looked at it? If you haven't, then I recommend that you spend a couple of hours with this document before we continue with this thread.

    The manual is huge and may seem scary, but it is in free-standing chapters so you don't have to read everything.

    But there are three important chapters in it:
    - Pin Configuration
    - Pin connect block
    - General Purpose Input/Output ports (GPIO)

    Since you already know how to flash a LED, you already know how to set a GPIO signal as input or output. And you know how to write to the port.

    By reading the third of my suggested chapters, it should quickly follow how to read from a GPIO pin.

    Polling is nothing fancier than to read from a pin, make a dceision. Do something. Then repeat the loop again.

Children