PIC18F25K83单片机例程


单片机型号PIC18F25K83,开发环境为MPLAB X IDE V4.05,例程包含I/O,TIM,UART,I2C,CAN,ADC程序,全部手敲并调试完成,需要的小伙伴们可以拿去参考一下。
资源截图
代码片段和文件信息
/*
 * File:   main.c
 * Author: Jefenson
 *
 * Created on 2018年3月28日 上午11:42
 */

// CONFIG1L
#pragma config FEXTOSC = HS     // External Oscillator Selection (HS (crystal oscillator) above 8 MHz; PFM set to high power)
#pragma config RSTOSC = EXTOSC_4PLL// Reset Oscillator Selection (EXTOSC with 4x PLL with EXTOSC operating per FEXTOSC bits)

// CONFIG1H
#pragma config CLKOUTEN = OFF   // Clock out Enable bit (CLKOUT function is disabled)
#pragma config PR1WAY = ON      // PRLOCKED One-Way Set Enable bit (PRLOCK bit can be cleared and set only once)
#pragma config CSWEN = ON       // Clock Switch Enable bit (Writing to NOSC and NDIV is allowed)
#pragma config FCMEN = ON       // Fail-Safe Clock Monitor Enable bit (Fail-Safe Clock Monitor enabled)

// CONFIG2L
#pragma config MCLRE = EXTMCLR  // MCLR Enable bit (If LVP = 0 MCLR pin is MCLR; If LVP = 1 RE3 pin function is MCLR )
#pragma config PWRTS = PWRT_OFF // Power-up timer selection bits (PWRT is disabled)
#pragma config MVECEN = OFF     // Legacy interrupt behavior
#pragma config IVT1WAY = ON     // IVTLOCK bit One-way set enable bit (IVTLOCK bit can be cleared and set only once)
#pragma config LPBOREN = OFF    // Low Power BOR Enable bit (ULPBOR disabled)
#pragma config BOREN = SBORDIS  // Brown-out Reset Enable bits (Brown-out Reset enabled  SBOREN bit is ignored)

// CONFIG2H
#pragma config BORV = VBOR_2P45 // Brown-out Reset Voltage Selection bits (Brown-out Reset Voltage (VBOR) set to 2.45V)
#pragma config ZCD = OFF        // ZCD Disable bit (ZCD disabled. ZCD can be enabled by setting the ZCDSEN bit of ZCDCON)
#pragma config PPS1WAY = ON     // PPSLOCK bit One-Way Set Enable bit (PPSLOCK bit can be cleared and set only once; PPS registers remain locked after one clear/set cycle)
#pragma config STVREN = ON      // Stack Full/Underflow Reset Enable bit (Stack full/underflow will cause Reset)
#pragma config DEBUG = ON       // Debugger Enable bit (Background debugger enabled)
#pragma config XINST = OFF      // Extended Instruction Set Enable bit (Extended Instruction Set and Indexed Addressing Mode disabled)

// CONFIG3L
#pragma config WDTCPS = WDTCPS_31// WDT Period selection bits (Divider ratio 1:65536; software control of WDTPS)
#pragma config WDTE = OFF       // WDT operating mode (WDT Disabled; SWDTEN is ignored)

// CONFIG3H
#pragma config WDTCWS = WDTCWS_7// WDT Window Select bits (window always open (100%); software control; keyed access not required)
#pragma config WDTCCS = SC      // WDT input clock selector (Software Control)

// CONFIG4L
#pragma config BBSIZE = BBSIZE_512// Boot Block Size selection bits (Boot Block size is 512 words)
#pragma config BBEN = OFF       // Boot Block enable bit (Boot block disabled)
#pragma config SAFEN = OFF      // Storage Area Flash enable bit (SAF disabled)
#pragma config WRTAPP = OFF     // Application Block write protection bit (Application Block not write protected)

// CONFIG4H
#pragma co

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    1312940  2018-03-28 16:58  ADC.Xuilddefaultdebugmain.p1

     文件         74  2018-03-28 16:58  ADC.Xuilddefaultdebugmain.p1.d

     文件     682915  2018-03-28 16:58  ADC.Xuilddefaultdebugmain.pre

     文件    1312940  2018-03-28 16:58  ADC.Xuilddefaultproductionmain.p1

     文件         84  2018-03-28 16:58  ADC.Xuilddefaultproductionmain.p1.d

     文件     682915  2018-03-28 16:58  ADC.Xuilddefaultproductionmain.pre

     文件      24694  2018-03-28 16:58  ADC.XdistdefaultdebugADC.X.debug.cmf

     文件      13988  2018-03-28 16:58  ADC.XdistdefaultdebugADC.X.debug.elf

     文件       1141  2018-03-28 16:58  ADC.XdistdefaultdebugADC.X.debug.hxl

     文件      47788  2018-03-28 16:58  ADC.XdistdefaultdebugADC.X.debug.lst

     文件      26596  2018-03-28 16:58  ADC.XdistdefaultdebugADC.X.debug.map

     文件        465  2018-03-28 16:58  ADC.XdistdefaultdebugADC.X.debug.mum

     文件       6113  2018-03-28 16:58  ADC.XdistdefaultdebugADC.X.debug.obj

     文件      53031  2018-03-28 16:58  ADC.XdistdefaultdebugADC.X.debug.rlf

     文件      10279  2018-03-28 16:58  ADC.XdistdefaultdebugADC.X.debug.sdb

     文件       7533  2018-03-28 16:58  ADC.XdistdefaultdebugADC.X.debug.sym

     文件        435  2018-03-28 16:58  ADC.Xdistdefaultdebugmemoryfile.xml

     文件      27014  2018-03-28 16:58  ADC.XdistdefaultproductionADC.X.production.cmf

     文件      13988  2018-03-28 16:58  ADC.XdistdefaultproductionADC.X.production.elf

     文件        957  2018-03-28 16:58  ADC.XdistdefaultproductionADC.X.production.hex

     文件       1161  2018-03-28 16:58  ADC.XdistdefaultproductionADC.X.production.hxl

     文件      47788  2018-03-28 16:58  ADC.XdistdefaultproductionADC.X.production.lst

     文件      26646  2018-03-28 16:58  ADC.XdistdefaultproductionADC.X.production.map

     文件        465  2018-03-28 16:58  ADC.XdistdefaultproductionADC.X.production.mum

     文件       6133  2018-03-28 16:58  ADC.XdistdefaultproductionADC.X.production.obj

     文件      53031  2018-03-28 16:58  ADC.XdistdefaultproductionADC.X.production.rlf

     文件      10279  2018-03-28 16:58  ADC.XdistdefaultproductionADC.X.production.sdb

     文件       7543  2018-03-28 16:58  ADC.XdistdefaultproductionADC.X.production.sym

     文件        445  2018-03-28 16:58  ADC.Xdistdefaultproductionmemoryfile.xml

     文件       6233  2018-03-28 16:58  ADC.Xmain.c

............此处省略272个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)