Programming 16-Bit PIC Microcontrollers in C
eBook - ePub

Programming 16-Bit PIC Microcontrollers in C

Learning to Fly the PIC 24

  1. 416 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Programming 16-Bit PIC Microcontrollers in C

Learning to Fly the PIC 24

About this book

New in the second edition: - MPLAB X support and MPLAB C for the PIC24F v3 and later libraries- I2Cā„¢ interface- 100% assembly free solutions- Improved video, PAL/NTSC- Improved audio, RIFF files decoding- PIC24F GA1, GA2, GB1 and GB2 support Most readers will associate Microchip's name with the ubiquitous 8-bit PIC microcontrollers but it is the new 16-bit PIC24F family that is truly stealing the scene. Orders of magnitude increases of performance, memory size and the rich peripheral set make programming these devices in C a must. This new guide by Microchip insider Lucio Di Jasio teaches readers everything they need to know about the architecture of these new chips: How to program them, how to test them, and how to debug them. Di Jasio's common-sense, practical, hands-on approach starts out with basic functions and guides the reader step-by-step through even the most sophisticated programming scenarios. Experienced PIC users, including embedded engineers, programmers, designers, and SW and HW engineers, and new comers alike will benefit from the text's many thorough examples, which demonstrate how to nimbly sidestep common obstacles and take full advantage of the many new features.!- A Microchip insider introduces you to 16-bit PIC programming the easy way!- Condenses typical introductory "fluff" focusing instead on examples and exercises that show how to solve common, real-world design problems quickly- Includes handy checklists to help readers perform the most common programming and debugging tasks

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Programming 16-Bit PIC Microcontrollers in C by Lucio Di Jasio in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming Languages. We have over one million books available in our catalogue for you to explore.

Information

Part I
First Flights
Outline
Chapter 1

The First Flight

Publisher Summary

The chapter explores that the first flight for every student pilot seems to be typically a vague impression. Generally, it is a sequence of brief but very intense sensations including the rush of the first take off, which is performed by the instructor. The chapter reveals the white-knuckled, sweaty grip on the yoke while trying to keep the plane flying straight for a couple of minutes. After that the instructor gives the standard speech on various languages. Sometimes an acute motion sickness happens among the passengers. It is also depicted that as the instructor returns for the landing and performs a sickness inducing maneuver, termed ā€œside slip,ā€ it looks like the runway is coming through the side window. This chapter is of no difference for those who are new to the world of embedded programming. However, every flight possesses a purpose, and preparing a flight plan is the best way to begin.
The first flight for every student pilot is typically a blur – a sequence of brief but very intense sensations, including:
• The rush of the first take off, which is performed by the instructor.
• The white-knuckled, sweaty grip on the yoke while trying to keep the plane flying straight for a couple of minutes, after the instructor gives the standard ā€œanybody that can drive a car can do thisā€ speech.
• Acute motion sickness, as the instructor returns for the landing and performs a sickness-inducing maneuver, called the ā€œside slipā€, where it looks like the runway is coming through the side window.
For those who are new to the world of embedded programming, this first chapter will be no different.

Flight Plan

Every flight should have a purpose, and preparing a flight plan is the best way to start.
This is going to be our first project with the PIC24 16-bit microcontroller and, for some of you, the first project with the MPLABĀ® X IDE Integrated Development Environment and the MPLAB C language suite. Even if you have never heard before of the C language, you might have heard of the famous ā€œHello World!ā€ programming example. If not, let me tell you about it.
Since the very first book on the C language, written by Kernighan and Ritchie several decades ago, every decent C-language book has featured an example program containing a single statement to display the words ā€œHello Worldā€ on the computer screen. Hundreds, if not thousands, of books have respected this tradition, and I don’t want this book to be the exception. However, it will have to be just a little different. Let’s be realistic, we are talking about programming microcontrollers because we want to design embedded-control applications. While the availability of a monitor screen is a perfectly safe assumption for any personal computer or workstation, this is definitely not the case in the embedded-control world. For our first embedded application we better stick to a more basic type of output – a digital I/O pin. In a later and more advanced chapter we will be able to interface to an LCD display and/or a terminal connected to a serial port. But, by then we will have better things to do than writing ā€œHello World!ā€

Preflight Checklist

Each flight is preceded by a preflight inspection – simply a walk around the airplane where we check that, among many other things, gas is in the tank and the wings are still attached to the fuselage. So, let’s verify we have all the necessary pieces of equipment ready and installed/connected:
• MPLAB X IDE, free Integrated Development Environment (obtain the latest version available for download from Microchip’s website at http://www.microchip.com/mplab)
• MPLAB C30 Lite Compiler v3.30 (or later) or MPLAB XC16 Lite Compiler
• A PIC24FJ128GA010 on a PIM (also known as a mezzanine board)
• An MPLAB X compatible programmer/debugger such as the PICkit3, ICD3 or Real ICE
• The Explorer16 board, or any demo board with a row of eight LEDs connected to PortA.
Let’s follow the New Project Setup checklist to create a new project.
From the Start Page of MPLAB X, select Create New Project, or simply select File>New Project… from the main menu to activate the new project wizard, which will guide us automatically through the following six steps:
1. Choose Project: in the Categories panel, select the Microchip Embedded option. In the Projects panel, select Stand alone Project and click Next.
2. Select Device: in the Family drop box, select PIC24. In the Device drop box, select PIC24FJ128GA010, or other PIC24 model of your choice and click Next.
3. Select Header: simply click Next.
4. Select Tool: select the PICKit3, or other supported programmer/debugger of your choice, and click Next.
5. Select Compiler: select C30 (or XC16 if available), and click Next.
6. Select Project Name and Folder: type 1-HelloWorld as the project name, type C:\FlyingPIC24 as the folder name or use the...

Table of contents

  1. Cover image
  2. Title page
  3. Table of Contents
  4. Copyright
  5. Dedication
  6. Preface
  7. Introduction to the Second Edition
  8. Introduction
  9. Part I: First Flights
  10. Part II: Flying ā€œSoloā€
  11. Part III: Cross-Country Flying
  12. Index