单片机软硬件设计...吧 关注:13贴子:79
  • 1回复贴,共1

利用MPLABX新建PIC单片机工程(巨详细,一看就会)

只看楼主收藏回复

视频来自:百度贴吧


IP属地:浙江1楼2023-10-04 13:30回复
    /*
    * File: newmain.c
    * Author: ACER
    *
    * Created on March 31, 2024, 5:44 PM
    */
    #pragma config FOSC = EXTRC // Oscillator Selection bits (RC oscillator)
    #pragma config WDTE = ON // Watchdog Timer Enable bit (WDT enabled)
    #pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled)
    #pragma config CP = OFF // FLASH Program Memory Code Protection bits (Code protection off)
    #pragma config BOREN = ON // Brown-out Reset Enable bit (BOR enabled)
    #pragma config LVP = ON // Low Voltage In-Circuit Serial Programming Enable bit (RB3/PGM pin has PGM function; low-voltage programming enabled)
    #pragma config CPD = OFF // Data EE Memory Code Protection (Code Protection off)
    #pragma config WRT = ALL // FLASH Program Memory Write Enable (Unprotected program memory may be written to by EECON control)
    #include <xc.h>
    #include<stdio.h>
    void main() {
    printf("hello,world!");
    TRISD=0X01;
    while(1);
    }
    提示:newmain.c:22: error: (192) undefined identifier "TRISD"是为什么?
    本人是pic小白,望大神指点。


    IP属地:湖北2楼2024-04-16 18:59
    回复