Microchip Technology MCP6 series Datasheet

Browse online or download Datasheet for Motherboards Microchip Technology MCP6 series. Microchip Technology MCP6 series Datasheet User Manual

  • Download
  • Add to my manuals
  • Print

Summary of Contents

Page 1 - Elmer 166

dsPICElmer 166An introduction to using the dsPICJohn J. McDonough, WB8RCR

Page 3

Chapter 2.5First Program - Blink an LEDThe first program will be the classic "flash an LED" program. This provides a simple look into progra

Page 4

Chapter 2. First Program - Blink an LED6 The first time MPLAB-X is launched it will display the MPLAB-X "Start Page". The start page has ma

Page 5

Creating the project7 The first panel chooses the overall type of project. Almost always the default selections of "MicrochipEmbedded" and

Page 6

Chapter 2. First Program - Blink an LED8 The next selection is for the hardware programming or debugging tool. In this exercise, the simulator willbe

Page 7 - Overview

Creating the project9In the final project wizard panel, enter a name for the project.Figure 2.8. Assign project name

Page 8 - 1.2. The dsPIC30F4011

Chapter 2. First Program - Blink an LED10 Two panes will open on the left of the main MPLAB-X window. The upper pane (labeled Projects) willlist the

Page 9 - 1.3. Building Programs

Editing and Compiling the Source112.2. Editing and Compiling the Source Once a project has been created, the next order of business is to create a fi

Page 10

Chapter 2. First Program - Blink an LED12A dialog will open allowing you to provide a name for the project. Be certain the filename you choose endsin

Page 11 - First Program - Blink an LED

Editing and Compiling the Source13Figure 2.12. Add codeFigure 2.13. Compile button

Page 12

Elmer 166dsPIC Elmer 166An introduction to using the dsPICEdition 1Author John J. McDonough, WB8RCR [email protected] text of and illustrations in th

Page 13

Chapter 2. First Program - Blink an LED142.3. Running the SimulatorFigure 2.14. Set a breakpointFigure 2.15. Debug program buttonFigure 2.16. Debuggin

Page 14

Running the Simulator15Figure 2.17. Second toolbar rowFigure 2.18. Open the variables window

Page 15 - Creating the project

Chapter 2. First Program - Blink an LED16Figure 2.19. Create a watch expressionFigure 2.20. Select the variable to watchFigure 2.21. Observe the value

Page 16

Debugging the program17Figure 2.22. Download program button2.5. Debugging the program 2.6. Documenting the program /* Exercise01_main.c - Blink an LED

Page 17

Chapter 2. First Program - Blink an LED18// Ex02.c - Blink an LED#include <xc.h> int main (void){ _TRISD3 = 0;

Page 18

Chapter 3.19Configuration Registers // Configuration fuses_FOSC (XT) // 7.3728 xtal / 4 = 1.8432 MIPS_FWDT (WDT_OFF)

Page 20 - 2.3. Running the Simulator

Chapter 4.21Timers // Set up timer // 7.3728 MHz * 16xPLL /Fosc/4 / 256 prescaler / 57600 counter // timer should fire twice per second. Since the

Page 22

Chapter 5.23Interrupts // Set up timer // 7.3728 MHz * 16xPLL /Fosc/4 / 256 prescaler / 57600 counter // timer should fire twice per second. Since

Page 25 - Configuration Registers

Chapter 6.25Liquid Crystal Displays

Page 27 - Chapter 4

Chapter 7.27The I2C Device RoutinesThere are a large number of parts available using the Inter-Integrated Circuit, or I2C, communicationsprotocol. I2C

Page 28

Chapter 7. The I2C Device Routines28Since the DAC is a relatively simple device, using the routine is quite straightforward. Although theMCP4726 inclu

Page 29 - Interrupts

Using the MCP23008 I/O Expander29The MCP23008 I/O Expander is a more complex device[MCP5]. It has eight I/O pins, each of which maybe configured as an

Page 30

Chapter 7. The I2C Device Routines307.4. Using the MB85RC16V FRAMThe MB85RC16V Ferroelectric Random Access Memory[FUJ1] is a 2Kx8 non-volatile memory

Page 31 - Liquid Crystal Displays

Chapter 8.31The I2C LibraryIn addition to the device routines, the library includes a complete set of low level I2C routines for deviceswith seven bit

Page 32

Chapter 8. The I2C Library328.3. Sending data to an I2C deviceThus to send data to a device the sequence is: starting the transaction, sending the con

Page 33 - C Device Routines

Chapter 9.33Building Libraries

Page 34

Elmer 166ivC.3.3. Structure and Union types ... 59C.4. Control Flow

Page 36 - 7.4. Using the MB85RC16V FRAM

Chapter 10.35Analog Inputs // Initialize ADC /* set port configuration here */ ADPCFGbits.PCFG8 = 0; // ensure AN8/RB8 is analog /* set channel s

Page 38 - 8.4. Reading data from an I

Chapter 11.37Reading Switches

Page 40

Chapter 12.39Pulse Width Modulation // Set up timer 2 for PWM TMR2 = 0; // Clear timer 2 PR2 = 1000; // Timer 2 cou

Page 42

Chapter 13.41Serial Output

Page 44

Chapter 14.43Serial Input

Page 47 - Serial Output

Chapter 15.45Unusual Devices

Page 49 - Serial Input

47Appendix A. Installing MPLAB-X Figure A.1. Locate the Development ToolsFigure A.2. Select Tools to Download

Page 50

Appendix A. Installing MPLAB-X48Figure A.3. Open Downloaded InstallerFigure A.4. Allow it to run

Page 51 - Unusual Devices

49Figure A.5. Install WizardFigure A.6. XC Already Downloaded

Page 53

51Appendix B. Setting up a project inMPLAB-X Figure B.1. MPLAB-X Desktop IconFigure B.2. New Project ButtonFigure B.3. MPLAB-X Project Type

Page 54 - Figure A.4. Allow it to run

Appendix B. Setting up a project in MPLAB-X52Figure B.4. Selecting the ProcessorFigure B.5. Select Programmer/DebuggerFigure B.6. Selecting the Toolch

Page 55 - Figure A.5. Install Wizard

53Figure B.8. Create a Source FileFigure B.9. Name the Source File

Page 58

55Appendix C. The C LanguageC.1. IntroductionThis appendix will not turn you into an expert C programmer, nor is it even a decent tutorial. it will,ho

Page 59

Appendix C. The C Language56that long. Of course, this can have very unfortunate side effects. But C has great faith that you knew whatyou were doing

Page 60

Array and Pointer types57Type Bits Min Maxunsigned long long 64 0 18446744073709551615 The following are the floating point types: Table C.2. Floati

Page 61 - Appendix C. The C Language

Appendix C. The C Language58A pointer is specified by prefixing the name with an * in the declaration. Thus, int *n; specifies apointer, n, which poin

Page 62 - C.2. Identifiers

Structure and Union types59C.3.3. Structure and Union types struct { int PointID; double Temperature; double ScalingFactor; double Offset

Page 64

61Appendix D. The dsPIC-EL Board

Page 66

63Appendix E. Microchip PIC Families Figure E.1. PIC Families

Page 67

Chapter 1.1Overview1.1. Overview of MicrocontrollersA microcontroller is a microprocessor intended for embedded1 applications.Microcontrollers differ

Page 69 - Figure E.1. PIC Families

65Appendix F. Compiler Support LocationsThe following directories are all relative to the compiler install directory which is typically something like

Page 71

67Appendix G. Revision HistoryRevision 0-3 Sun Jan 20 2013 John McDonough [email protected] correctionsRevision 0-2 Wed Jan 9 2013 John McDonough wb

Page 73 - Appendix G. Revision History

69Bibliography[Barr] Michael Barr. Copyright © 2012 Barr Group. Barr Group . Embedded Systems Glossary. E.[FUJ1] Sales Promotion Department, Fujitsu

Page 75 - Bibliography

71IndexAAckI2C, 31ACKstatusI2C, 31ANSI C, 56Array, 55BBackspace characterin character literals, 57Basic, 55Bell characterin character literals, 57Brow

Page 76

Index72MCP23008writeRegister, 29MCP4726, 27, 32MCP4726write, 28MPLAB-Xicon, 5launching, 5New project, 6New project wizard, 6Start page, 6MPLAB-X proje

Page 77

Chapter 1. Overview2Figure 1.1. dsPIC OverviewTable 1.1. The dsPIC30F FamilyMinimum Maximum dsPIC30F4011Program Memory 6K 144K 48KData Memory 256 8192

Page 78

Building Programs31.3. Building ProgramsFigure 1.3. Program Building Process

Comments to this Manuals

No comments