Getting Started with PIC24F/PIC24H Programming and Interfacing in C

Similar documents
Getting Started with PIC24F/PIC24H Programming and Interfacing in C

PICNet 1. PICNet 1 PIC18 Network & SD/MMC Development Board. Features. Applications. Description

How To Program A Microcontroller Board (Eb064) With A Psp Microcontroller (B064-74) With An Ios 2.5V (Power) And A Ppt (Power Control) (Power Supply) (

Switch board datasheet EB

Introduction. Getting familiar with chipkit Pi

Fondamenti su strumenti di sviluppo per microcontrollori PIC

Evo Laser Firmware Developer s Manual

FlowKit in-circuit debug system

LED board datasheet EB

AN-812 APPLICATION NOTE

Processor Extension Pak and Header Specification

An Introduction to MPLAB Integrated Development Environment

PICkit 3 Programmer/Debugger User s Guide

RS232 Board datasheet

Using Xbee in Serial Communication

Programming PIC Microcontrollers in PicBasic Pro Lesson 1 Cornerstone Electronics Technology and Robotics II

USBSPYDER08 Discovery Kit for Freescale MC9RS08KA, MC9S08QD and MC9S08QG Microcontrollers User s Manual

INDEX. Trademarks All name and product s trademarks mentioned below are the property of their respective companies.

New Product Brief 750 Naples Street San Francisco, CA (415)

RC2200DK Demonstration Kit User Manual

M68EVB908QL4 Development Board for Motorola MC68HC908QL4

XBee USB Adapter Board (#32400)

3. Identification of water pumps through RFID technology. 4. Wireless control of remote water pump using RF technology.

Universal ICSP-Programming-Adapter for all PIC s in DIL-Housings

Schematic & Parts List: PIC16F688 Satellite Tracker & Rotor Controller

Welcome to the tutorial for the MPLAB Starter Kit for dspic DSCs

K8048 PIC PROGRAMMER BOARD

PICmicro tm Development Board

FLYPORT Wi-Fi G

Accurate Measurement of the Mains Electricity Frequency

Tutorial for MPLAB Starter Kit for PIC18F

DKWF121 WF121-A B/G/N MODULE EVALUATION BOARD

How To Use Microchip.Com

AVRprog. programmer by MikroElektronika

The modular concept of the MPA-3 system is designed to enable easy accommodation to a huge variety of experimental requirements.

BE635 User Manual. Rev. V Bolymin, Inc. All Rights Reserved.

User s Manual of Board Microcontroller ET-MEGA2560-ADK ET-MEGA2560-ADK

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Microprocessor Project Laboratory

HC(S)08-System for Development and Training

EasyPIC4 User s Manual

MX PIC24F Educational Module User Manual

R4/F4 Series Master Development System User's Guide

MFRD52x. Mifare Contactless Smart Card Reader Reference Design. Document information

Wireless Temperature

CAN bus board. EB018

ZigBee-2.4-DK 2.4 GHZ ZIGBEE DEVELOPMENT KIT USER S GUIDE. 1. Kit Contents. Figure GHz ZigBee Development Kit

MPLAB ICD 3 In-Circuit Debugger User s Guide For MPLAB X IDE

Controlling a Dot Matrix LED Display with a Microcontroller

DsPIC HOW-TO GUIDE Creating & Debugging a Project in MPLAB

MPLAB C18 C Compiler

THE TRANSITION FROM THE 8085 TO THE MODERN WORLD

Embedded Software development Process and Tools: Lesson-3 Host and Target Machines

DSO138 oscilloscope program upgrade method

SM1231 USER GUIDE SM1231 RF MODULE USER GUIDE

Peak Power Tracker Circuit Description (from

Bluetooth + USB 16 Servo Controller [RKI-1005 & RKI-1205]

PICkit 3 Programmer/Debugger User s Guide

ENGS 32 Winter, Prototyping Methods

Thermostat Application Module Kit

PCAN-MicroMod Evaluation Test and Development Environment for the PCAN-MicroMod. User Manual. Document version ( )

Advanced Data Capture and Control Systems

dspic30f4012 Microcontroller

SERVO CONNECTIONS FOR OLDER BOARDS

Schematic & Parts List: PIC16F688 Satellite Tracker & Rotor Controller

DRV8312-C2-KIT How to Run Guide

Lab 1 Course Guideline and Review

TELE-SAFE HOME SECURITY SYSTEM

Lesson 1 - Creating a C18 Project with MPLAB

ECIO40P ECIO28P ECRM40. Page 1. USB programmable microcontrollers. 0.6 DIP footprint. Supplied with a free version of Flowcode. E-blocks compatible

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

Processor Extension Pak (PEP) and Debug Header Specification

Nuvoton Nu-Link Debug Adapter User Manual

How To Develop A Toolstick

TEECES DOME LIGHTING SYSTEMS

Ocean Controls RC Servo Motor Controller

PICkit 3 In-Circuit Debugger/Programmer User s Guide

When the program is complied, built, and sent to the programmer, the return is an ERROR 27 message and the programming stops.

Adafruit MCP9808 Precision I2C Temperature Sensor Guide

Phase II Design for a Multiband LMR Antenna System

ECEN 1400, Introduction to Analog and Digital Electronics

Introduction to PIC Programming

The $25 Son of a cheap timer This is not suitable for a beginner. You must have soldering skills in order to build this kit.

Cumbria Designs T-1. SSB/CW Filter kit (4.9152MHz) User Manual

How to connect to a Class II router using a mobile-phone data cable specifically for Solwise & Safecom routers

2.0 Command and Data Handling Subsystem

Review of. 4x IOcards (PCBs) Manufactured by Opencockpits

C Programming Structure of a C18 Program

SMARTCARD XPRO. Preface. SMART ARM-based Microcontrollers USER GUIDE

1. The demonstration code is sending garbage to my terminal program. What are the recommended settings?

PolyBot Board. User's Guide V1.11 9/20/08

PICAXE RF CONNECT KIT (AXE213)

Chapter 12. Development Tools for Microcontroller Applications

Web Site: Forums: forums.parallax.com Sales: Technical:

Lecture N -1- PHYS Microcontrollers

BUILDING INSTRUCTIONS

Description of High Accuracy Digital Pressure Gauge Design

PROJECT PRESENTATION ON CELLPHONE OPERATED ROBOTIC ASSISTANT

PICkit 2 Microcontroller Programmer USER S GUIDE

K8068 BUS DIMMER FOR HOME MODULAR LIGHT SYSTEM ILLUSTRATED ASSEMBLY MANUAL H8068IP-1

Design and Implementation of an Accidental Fall Detection System for Elderly

Transcription:

Getting Started with PIC24F/PIC24H Programming and Interfacing in C This series of short articles covers the basics of programming a PIC24FJ32GA002/PIC24H 16-bit microcontroller, using Microchip s free C30 compiler. These articles assume a very basic understanding of Microchip microcontrollers and development tools, especially MPLAB IDE. A number of projects will be presented, which are based upon using a low cost PIC24F/H board as the main platform, Microchip s free C30 C compiler, and a low cost PICKIT2 (or PICKIT3) used for programming and debugging function. S Gupta www.mcjournal.com Page 1

Project 0 Building the Laboratory Board Introduction In this article the tools (software and hardware) needed for experimentation with PIC24F (and PIC24H) microcontroller are discussed. The discussion will include the description of the PIC24F/H board, its general specifications, and populating the PIC24 PC board with minimal hardware necessary for getting started in PIC24 programming. Figure 1 PIC24 Board Layout The PIC24F/H Board Figure 1 shows the layout of the board. The board has been designed to provide a low cost platform that can accommodate 28-pin version of various PIC24F and PIC24H series of microcontrollers and allows the use of breadboard for interfacing. At the same time, the board can be used in a turnkey application with suitable external interfaces. The board is available in various versions: Bare pc board Minimum kit pc board, 28-pin socket, 30 pin male header, 6-pin PICKIT2/3 header, capacitors Full kit Partially assembled - minimum kit version The board capabilities are discussed as follows: S Gupta www.mcjournal.com Page 2

Interface Connector Every single pin of 28-pin PIC24F/H microcontroller is brought to a 30 pin header, along with connections for an external power. With a 30-pin male header soldered, the board can be inserted in a standard breadboard, exposing all connections for interfacing, while enjoying the convenience of a bread board. Figure 2 PIC24 Bare Board Voltage Input Stage The voltage can be applied either through a barrel connector using DC adapter (5 to 9 VDC) or a through a 2-pin screw terminal connector. In this case, 3.3V voltage regulator circuit (on-board) will need to be populated. During the develop stage, the board can be simply be powered through PICKIT2/3. PICKIT 2/3 header For interface to Microchip s low cost PICKIT 2/3A debugger and Programmer a 6-pin header can be installed. Power-on LED A LED with associated current limiting LED can be installed to provide a visual indication of power. AVSS and AVDD Jumpers Some versions of PIC24 contain AVDD and AVSS (AGND) pins for using external precision power supply for A/D Converter, while in some other devices, these pins are supposed to be connected to digital VSS and VDD supply. This can be managed by two jumpers that can be closed for using digital VSS and VDD and left open for using an external voltage source Reset Switch A reset switch S1 is available for use, when using the board in a target application. It is not recommended to use a reset switch, while the PICKIT 2/3 is interfaced to the board. S Gupta www.mcjournal.com Page 3

Figure 3 PIC24 Board Power Supply The Schematic Diagram The schematics of the board are shown in Figure 3 and 4. Figure 3 shows the supply input section using either the barrel connector or the terminal. LED1 and R5, if populated, provide a visual indication of the board power up status. Figure 4 shows the interface between the PIC24 microcontroller and the interface connector. Figure 4 PIC24 Board MCU and Interface Connector S Gupta www.mcjournal.com Page 4

Preparing the Minimal System For a bare minimum configuration and using the following are essential. PICKIT 2/3 PICKIT 2 or PICKIT 3 is a very affordable Debugging and Programming tool that works seamlessly with MPLAB and various programming language suites that can be used with it. It can also be used with other devices from Microchip, e.g. PIC16, PIC18, PIC24, and PIC32, to name a few. It is possible to use the board with a bootloader, but that is something which does not pay off in the long run and is not being recommended here. Computer with MPLAB and C30 MPLAB and C30 can be freely downloaded from Microchip s website (www.microchip.com). The free version of C30 is practically same as the full blown version and the main difference lies in the lack of some of the optimizations that are only available in commercial version. In any case, on a new download, the full commercial version is made available for 60 days, after which the optimizations become ineffective. Minimally populated PIC24 board The minimally populated board will consist of PIC24 microcontroller, 4 capacitors, and 6 pin PICKIT 2/3 header. It is highly recommended to use a 28 pin (narrow) socket so that different versions of PIC24 microcontrollers (PIC24F and/or PIC24H) may be used. For interfacing a 30 pin male/female header will prove to be indispensible. A diagram of the minimally populated board with female header is shown below. Any suitable PIC24 microcontroller can be installed in the 28-pin socket. Figure 5 PIC24 Minimally Populated Board with Female Header S Gupta www.mcjournal.com Page 5

Next Time Armed with the laboratory board, fun with PIC24 microcontroller can now begin. The next project will see a Hello LED (equivalent to ubiquitous Hello World ) program being developed and run on the PIC24 board. S Gupta www.mcjournal.com Page 6