Hello friends, I am new to ARM,and i want to learn how to write driver for a program that too in LPC2378.
void driver() { PINSEL4=0X00000000; PINMODE4=0X00000002; FIO2DIR=0X000000FF; FIO2PIN=0X00000000; RTC_PREINT=0X0000016E; RTC_PREFRAC=0X00006500; PCONP = 0X00000200; RTC_SEC = 0X00000000; RTC_MIN = 0X00000000; RTC_HOUR = 0X00000000; RTC_CCR = 0X00000001;
This is one of the example for Real Time Clock.I want to learn how to configure drivers for any other peripherals like LED,UARTS,etc.I have referred user manual as well as my LPC2378 data sheet but m not able to get the proper idea.
Thanks.
Thanks P.Westermark, I have selected one example for blinking the LEDs on ARM LPC2378,alternately. For that please suggest me what would be my first step as soon as i open the user manual documents.
"For that please suggest me what would be my first step as soon as i open the user manual documents."
Shouldn't that be obvious?
1) Spend some time paging through the rather large document to see what different chapters there are.
2) Spend some more time with the chapters that seems to be relevant to your interests.
3) Blinking a LED implies the use of an output from the processor. So focus on the chapter(s) covering GPIO (General Purpose Input/Output) configuration, i.e. how to use the processor pins "manually" for input/output as opposed to the special functions available where processor pins are associated with serial ports, interrupts etc.
4) Return back to the example codes you have found, and look at the source code lines you see. If you don't understand what a specific line does, you can jump to the processor user manual and read the description for that specific register. Repeat and rinse until you understand what the example program does, and why.
5) Modify the example program to add your own improvements based on your knowledge of the processor, and the information available in the processor user manual.
6) Test your changes and see if you get the result you expected.
7) Compare code with processor user manual again to figure out why your program did not behave as intended.
8) Correct the code and repeat from point 6 until it works. Then repeat from point 5 with further code improvements.
OK P.Wmark.. I will follow your suggestions rigoursly and will soon post. Thanks for your suggestions and motivative *** encouraging post. See you soon.
Thanks & Regards, M.blue
See you soon.
Take your time, bro, don't hurry.