Specifications
mikroElektronika | Free Online Book | PIC Microcontrollers | Appendix B: Examples
EXAMPLE 1
Writing header and configuring I/O pins
The only purpose of this program is to turn on a few LED diodes on port B. It is nothing special. Anyway, use this example
to study what a real program looks like. The figure below shows a connection scheme, while the program is on the next
page.
When switching on, every other LED diode on the port B emits light. That is enough to indicate that the microcontroller is
properly connected and operates normally.
This example gives the description of a correctly written header and a few initial directives. They represent a part of the
program used in all programs described in this book. To skip repetitiveness, it will not be written in the following
examples, but is considered to be at the beginning of every program (marked as a "Header").
http://www.mikroe.com/en/books/picmcubook/appb/ (19 of 54)5/3/2009 11:36:02 AM