Programming 16-Bit PIC Microcontrollers in C
eBook - ePub

Programming 16-Bit PIC Microcontrollers in C

Learning to Fly the PIC 24

Lucio Di Jasio

  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

Lucio Di Jasio

Book details
Book preview
Table of contents
Citations

About This Book

New in the second edition:

  • MPLAB X support and MPLAB C for the PIC24F v3 and later libraries
  • I 2 Cā„¢ 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

How do I cancel my subscription?
Simply head over to the account section in settings and click on ā€œCancel Subscriptionā€ - itā€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youā€™ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlegoā€™s features. The only differences are the price and subscription period: With the annual plan youā€™ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
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.
Do you support text-to-speech?
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.
Is Programming 16-Bit PIC Microcontrollers in C an online PDF/ePUB?
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 Informatique & Langues de programmation. We have over one million books available in our catalogue for you to explore.

Information

Publisher
Newnes
Year
2011
ISBN
9781856178716
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

Citation styles for Programming 16-Bit PIC Microcontrollers in C

APA 6 Citation

di Jasio, L. (2011). Programming 16-Bit PIC Microcontrollers in C (2nd ed.). Elsevier Science. Retrieved from https://www.perlego.com/book/1836239/programming-16bit-pic-microcontrollers-in-c-learning-to-fly-the-pic-24-pdf (Original work published 2011)

Chicago Citation

Jasio, Lucio di. (2011) 2011. Programming 16-Bit PIC Microcontrollers in C. 2nd ed. Elsevier Science. https://www.perlego.com/book/1836239/programming-16bit-pic-microcontrollers-in-c-learning-to-fly-the-pic-24-pdf.

Harvard Citation

di Jasio, L. (2011) Programming 16-Bit PIC Microcontrollers in C. 2nd edn. Elsevier Science. Available at: https://www.perlego.com/book/1836239/programming-16bit-pic-microcontrollers-in-c-learning-to-fly-the-pic-24-pdf (Accessed: 15 October 2022).

MLA 7 Citation

di Jasio, Lucio. Programming 16-Bit PIC Microcontrollers in C. 2nd ed. Elsevier Science, 2011. Web. 15 Oct. 2022.