I have been developing a small OS for my lpc1313fbd48. I am sending all of the C and assembly code in a binary file. I want to be able to call the ports in C and have an LED turn on for a few seconds and then turn on my vibrating motor (both of which are connected to the IOs on the microcontroller). How would I call the ports in C?
Calling ports in C on the microcontroller
assemblycmicrocontrolleroperating system
Best Answer
You don't "call" an IO port, you manipulate the registers that control it. You should have the LPC13xx.h file from NXP, which defines C data structures that you can use to access the ports. After including this file you can control the port pins in C with something like:
Of course you need to add a delay loop of some kind if you want to see the LED turn on and off.