Date post: | 21-Dec-2015 |
Category: |
Documents |
Upload: | rosamond-tucker |
View: | 217 times |
Download: | 0 times |
EEE305 Microcontroller Systems
• Lecture 4: The PIC microprocessor and the Microchip C Compilers
•Teaching resources on on www.eej.ulst.ac.uk
•My office 5B18, telephone 028 90 366364•My email [email protected]
http://www.eej.ulst.ac.uk/~ian/modules/EEE305 1/
http://www.eej.ulst.ac.uk/~ian/modules/EEE305
7
Learn to use datasheets:Either from www.microchip.com or www.farnell.co.uk
http://www.eej.ulst.ac.uk/~ian/modules/EEE305
14
Ignore OPTION_REG for the moment; simple use of PORTB is achieved by setting up each pin as an input or output and then sending data to an output pin or reading data from an input pin.
To configure a pin as an output set the corresponding bit in the TRIS register to zero.
http://www.eej.ulst.ac.uk/~ian/modules/EEE305
17
As well as the configuration symbols, such as the type of oscillator etc., we will also use symbols created for us to allow access to the special function registers (SFRs). Such as TRISB and PORTB. These are in uppercase
http://www.eej.ulst.ac.uk/~ian/modules/EEE305
20
MPLAB X and XC8As usual in these Integrated Development Environments (IDEs) you must be careful to specify a project name and folder BEFORE creating a source file.
Acknowledgements: I have referenced material from http://www.gooligum.com.au/tut_midrange_C.html Although this uses a slightly different processor much of his site is still validPlease read all 5 lessons – for your reading day next Friday.