欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 2280|回復: 0
打印 上一主題 下一主題
收起左側

PIC系列單片機配置字配置方法

[復制鏈接]
跳轉到指定樓層
樓主
以PIC18F4580單片機為例

PIC18F4580配置字
1、首先查看芯片手冊,找到配置字描述部分


2、Search for the header file for your device(pic18f458.h) in your compiler library directory. Then see what the names are for the bit masking(e.g. WDTDIS)…(根據實際硬件設計配置)
__CONFIG(1, OSC_HS); /* HS oscillator */__CONFIG(2, (BORV_3 & BOREN_BOHW & PWRT_OFF & WDT_OFF & WDTPS_32768)); /* VBOR set to 2.1V,                      Brown-out Reset enabled in hardware only (SBOREN is disabled),                      PWRT disabled,                      Watchdog Timer Postscale, 1:32,768                      WDT disabled (control is placed on the SWDTEN bit) */__CONFIG(3, (MCLRE_OFF & LPT1OSC_OFF & PBADEN_OFF)); /* MCLR pin enabled; RE3 input pin disabled,                      Timer1 configured for higher power operation,                      PORTB<4:0> pins are configured as digital I/O on Reset */__CONFIG(4, (DEBUG_OFF & BBSIZ_1024 & LVP_OFF & STVREN_ON)); /* Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins,                         Instruction set extension and Indexed Addressing mode disabled (Legacy mode),                         1K words (2 Kbytes) boot block,                         Single-Supply ICSP disabled,                         Stack full/underflow will cause Reset */

3、編譯之后,使用PICKit3升級固件,ImportHex時,可以看到配置字


4、正確配置PIC單片機配置字之后,可以解決程序無法啟動問題(一般是因為時鐘源沒有配置導致芯片沒有起振)


評分

參與人數 1黑幣 +50 收起 理由
admin + 50 共享資料的黑幣獎勵!

查看全部評分

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表