21.07.2013 Views

Introduction to Microcontrollers Lab Manual - Microchip

Introduction to Microcontrollers Lab Manual - Microchip

Introduction to Microcontrollers Lab Manual - Microchip

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

0.1 OBJECTIVE<br />

0.2 PRE-LAB<br />

<strong>Lab</strong> 0. <strong>Introduction</strong> <strong>to</strong> <strong>Microcontrollers</strong><br />

LABS<br />

This lab is an introduction <strong>to</strong> the following concepts required <strong>to</strong> complete the labs:<br />

• MX PIC24F EDU Module<br />

• <strong>Microchip</strong> PIC24FJ256GB110 MCU<br />

• 16-bit MCU Assembly Instruction Set<br />

• <strong>Microchip</strong> MPLAB IDE Software v8.63<br />

0.2.1 Reference Material<br />

• PIC24FJ256GB110 Family Data Sheet (DS39897)<br />

• 16-Bit MCU and DSC Programmer’s Reference <strong>Manual</strong> (DS70157)<br />

• MPLAB IDE User’s Guide (DS51519)<br />

0.2.2 Assembly Language<br />

All labs will be written in assembly language.<br />

Assembly language is a low-level language for programming computers, microprocessors,<br />

and microcontrollers. It is specific <strong>to</strong> a particular device or family of devices and<br />

is not typically portable between different processors.<br />

A utility program called an assembler is used <strong>to</strong> translate assembly language in<strong>to</strong> the<br />

target hardware machine code. These labs will use <strong>Microchip</strong>'s MPLAB ASM30 assembler<br />

<strong>to</strong> generate machine code for the PIC24FJ256GB110.<br />

Assembly language uses simple instructions, symbols, and numeric characters usually<br />

defined by either the assembler utility or the device hardware manufacturer.<br />

The assembler then performs a translation from the mnemonic assembly statements<br />

in<strong>to</strong> hardware specific machine instructions and data. The machine instructions can<br />

then be programmed in<strong>to</strong> the controller's memory and executed on the specific hardware.<br />

The “16-bit MCU and DSC Programmer's Reference <strong>Manual</strong>” (DS70157) from <strong>Microchip</strong><br />

is a complete list of all assembler instructions for the <strong>Microchip</strong> 16-bit processor<br />

family, including the PIC24FJ256GB110.<br />

A further suggestion from <strong>Microchip</strong>: <strong>Microchip</strong> Technology Inc. strongly suggests a<br />

.s extension for assembly source files. This will enable you <strong>to</strong> easily use the C compiler<br />

driver without having <strong>to</strong> specify the option <strong>to</strong> tell the driver that the file should be<br />

treated as an assembly file. See the “MPLAB C Compiler for PIC24 MCUs and dsPIC<br />

DSCs User's Guide” (DS51284) for more details on the C compiler driver.<br />

0.2.3 Timing<br />

The project initializes the PIC24FJ256GB110 <strong>to</strong> run from its internal Fast RC oscilla<strong>to</strong>r.<br />

It configures the use of the internal PLL <strong>to</strong> create an internal clock running at 32 MHz<br />

(Fosc). The architecture of the PIC24 specifies that an instruction cycle (Fcy) is com-<br />

2011 <strong>Microchip</strong> Technology Inc. DS51963A-page 7

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!