Clean: Deleting intermediary and output files.
Clean Warning: File "D:MYwork20110603DevelopingRFCmain.p1" doesn't exist.
Clean Warning: File "D:MYwork20110603DevelopingRFCMRF24J40.p1" doesn't exist.
Clean Warning: File "D:MYwork20110603DevelopingRFCSPI.p1" doesn't exist.
Clean: Done.
Build D:MYwork20110603DevelopingRFCRFCall for device 16F1933
Using driver C:Program FilesHI-TECH SoftwarePICC9.80inpicc.exe
Executing: "C:Program FilesHI-TECH SoftwarePICC9.80inpicc.exe" --pass1 D:MYwork20110603DevelopingRFCmain.c -q --chip=16F1933 -P --runtime=default --opt=default -D__DEBUG=1 -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
Error [192] D:MYwork20110603DevelopingRFCmain.c; 62.1 undefined identifier "INTIF"
Executing: "C:Program FilesHI-TECH SoftwarePICC9.80inpicc.exe" --pass1 D:MYwork20110603DevelopingRFCMRF24J40.c -q --chip=16F1933 -P --runtime=default --opt=default -D__DEBUG=1 -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
Error [192] D:MYwork20110603DevelopingRFC
MRF24J40.c; 9.1 undefined identifier "MRF_RST"
Warning [361] D:MYwork20110603DevelopingRFCMRF24J40.c; 11.1 function declared implicit int
Warning [361] D:MYwork20110603DevelopingRFCMRF24J40.c; 13.1 function declared implicit int
Warning [361] D:MYwork20110603DevelopingRFCMRF24J40.c; 16.1 function declared implicit int
Error [192] D:MYwork20110603DevelopingRFCMRF24J40.c; 16.20 undefined identifier "WRITE_SOFTRST"
Warning [361] D:MYwork20110603DevelopingRFCMRF24J40.c; 19.5 function declared implicit int
Error [192] D:MYwork20110603DevelopingRFCMRF24J40.c; 19.24 undefined identifier "READ_SOFTRST"
Error [192] D:MYwork20110603DevelopingRFCMRF24J40.c; 23.20 undefined identifier "WRITE_PACON2"
Error [192] D:MYwork20110603DevelopingRFCMRF24J40.c; 25.20 undefined identifier "WRITE_TXSTBL"
Warning [361] D:MYwork20110603DevelopingRFCMRF24J40.c; 27.1 function declared implicit int
Error [192] D:MYwork20110603DevelopingRFCMRF24J40.c; 27.19 undefined identifier "RFCON1"
Error [192] D:MYwork20110603DevelopingRFCMRF24J40.c; 29.19 undefined identifier "RFCON2"
Error [192] D:MYwork20110603DevelopingRFCMRF24J40.c; 31.19 undefined identifier "RFCON6"
Error [192] D:MYwork20110603DevelopingRFCMRF24J40.c; 33.19 undefined identifier "RFCON7"
Error [192] D:MYwork20110603DevelopingRFCMRF24J40.c; 35.19 undefined identifier "RFCON8"
Error [192] D:MYwork20110603DevelopingRFCMRF24J40.c; 39.20 undefined identifier "WRITE_BBREG2"
Error [192] D:MYwork20110603DevelopingRFCMRF24J40.c; 41.20 undefined identifier "WRITE_CCAEDTH"
Error [192] D:MYwork20110603DevelopingRFCMRF24J40.c; 43.20 undefined identifier "WRITE_BBREG6"
Error [192] D:MYwork20110603DevelopingRFCMRF24J40.c; 45.20 undefined identifier "WRITE_INTCON"
Warning [361] D:MYwork20110603DevelopingRFCMRF24J40.c; 47.1 function declared implicit int
Error [192] D:MYwork20110603DevelopingRFCMRF24J40.c; 47.12 undefined identifier "CHANNEL_11"
Warning [361] D:MYwork20110603DevelopingRFCMRF24J40.c; 53.5 function declared implicit int
Error [192] D:MYwork20110603DevelopingRFCMRF24J40.c; 53.23 undefined identifier "RFSTATE"
Error [192] D:MYwork20110603DevelopingRFCMRF24J40.c; 59.20 undefined identifier "WRITE_SADRL"
Error [192] D:MYwork20110603DevelopingRFCMRF24J40.c; 60.20 undefined identifier "WRITE_SADRH"
Error [192] D:MYwork20110603DevelopingRFCMRF24J40.c; 62.20 undefined identifier "WRITE_PANIDL"
Error [192] D:MYwork20110603DevelopingRFCMRF24J40.c; 63.20 undefined identifier "WRITE_PANIDH"
Error [192] D:MYwork20110603DevelopingRFCMRF24J40.c; 69.20 undefined identifier "WRITE_EADR0"
Advisory[1] too many errors (21)
Executing: "C:Program FilesHI-TECH SoftwarePICC9.80inpicc.exe" --pass1 D:MYwork20110603DevelopingRFCSPI.c -q --chip=16F1933 -P --runtime=default --opt=default -D__DEBUG=1 -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
Error [192] D:MYwork20110603DevelopingRFCSPI.c; 50.1 undefined identifier "PEIE"
Error [192] D:MYwork20110603DevelopingRFCSPI.c; 51.1 undefined identifier "GIE"
Error [192] D:MYwork20110603DevelopingRFCSPI.c; 53.1 undefined identifier "SSPIF"
Error [192] D:MYwork20110603DevelopingRFCSPI.c; 56.1 undefined identifier "WCOL"
Error [192] D:MYwork20110603DevelopingRFCSPI.c; 58.8 undefined identifier "SSPBUF"
Error [192] D:MYwork20110603DevelopingRFCSPI.c; 62.10 undefined identifier "WCOL"
Error [192] D:MYwork20110603DevelopingRFCSPI.c; 84.8 undefined identifier "SSPBUF"
************************************************以上是错误信息***************************************************
主函数的头文件名(RFCall.h):
#include <pic.h>
#include <string.h>
#include <stdlib.h>
#include "SPI.h"
#include "MRF24J40.h"
//GPIO
//Port A
#define LED2 LATA4 // Output
#define LED1 LATA5 // Output
#define MRF_WAKE LATA6 // Output
#define LATA_LOAD 0b00110000
#define TRISA_LOAD 0b00000000
//Port B
#define MRF_INT LATB0 // Input
#define SW LATB5 // Input
#define LATB_LOAD 0b00000000
#define TRISB_LOAD 0b00000000
//Port C
#define MRF_RST LATC0 // Output
(已经定义,但报错)
#define MRF_CS LATC2 // Output
#define SPI_SCK LATC3 // Output
#define SPI_SDI LATC4 // Input
#define SPI_SDO LATC5 // Output
以上头文件通过main.c函数以“#include "RFCall.h"”的指令包函。
MRF24J40.h头文件:
/*******************************************************************
*
* MRF24J40 Radio Defines
*
*********************************************************************
* FileName: MRF24J40.h
* Dependencies: None
* Processor: PIC18/PIC24
* Complier: MCC18 v1.00.50 or higher, C30 3.10 or higher
* HITECH PICC-18 V8.10PL1 or higher
* Company: Microchip Technology, Inc.
*
Software License Agreement
The software supplied herewith by Microchip Technology Incorporated
(the 揅ompany? for its PICmicro?Microcontroller is intended and
supplied to you, the Company抯 customer, for use solely and
exclusively on Microchip PICmicro Microcontroller products. The
software is owned by the Company and/or its supplier, and is
protected under applicable copyright laws. All rights are reserved.
Any use in violation of the foregoing restrictions may subject the
user to criminal sanctions under applicable laws, as well as to
civil liability for the breach of the terms and conditions of this
license.
THIS SOFTWARE IS PROVIDED IN AN 揂S IS?CONDITION. NO WARRANTIES,
WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED
TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT,
IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
**********************************************************************/
#ifndef _MRF24J40_H_
#define _MRF24J40_H_
//extern unsigned char currentRxByte;
//extern unsigned char currentTxByte;
//extern unsigned char phyIsIdle;
//00 000000
//00 表示0x000~0x030
//01 表示0x100~0x130
//10 表示0x200~0x230
//11 表示0x300~0x330
//long address registers
#define RFCON0 (0x80) //1000 0000
#define RFCON1 (0x81) //1000 0001
#define RFCON2 (0x82) //1000 0010
#define RFCON3 (0x83) //1000 0011
#define RFCON5 (0x85) //1000 0101
#define RFCON6 (0x86) //1000 0110
#define RFCON7 (0x87) //1000 0111
#define RFCON8 (0x88) //1000 1000
#define SLPCAL0 (0x89) //1000 1001
#define SLPCAL1 (0x8A) //1000 1010
#define SLPCAL2 (0x8B) //1000 1011
#define RFSTATE (0x8F) //1000 1111
#define RSSI (0x90) //1001 0000
#define SLPCON0 (0x91) //1001 0001
#define SLPCON1 (0xA0) //1010 0000
#define WAKETIMEL (0xA2) //1010 0010
#define WAKETIMEH (0xA3) //1010 0011
#define REMCNTL (0xA4) //1010 0100
#define REMCNTH (0xA5) //1010 0101
#define MAINCNT0 (0xA6) //1010 0110
#define MAINCNT1 (0xA7) //1010 0111
#define MAINCNT2 (0xA8) //1010 1000
#define MAINCNT3 (0xA9) //1010 1001
#define TESTMODE (0xAF) //1010 1111
//definitions for FIFOs in the memory
#define TX_NORMAL_FIFO (0x00) //0000 0000
//#define TX_BEACON_FIFO (0x080)
//#define TX_GTS1_FIFO (0x100)
//#define TX_GTS2_FIFO (0x180)
#define RX_FIFO (0xC0) //1100 0000
//#define SECURITY_KEY_FIFO (0x280)
//short address registers for reading
#define READ_RXMCR (0x00)
#define READ_PANIDL (0x02)
#define READ_PANIDH (0x04)
#define READ_SADRL (0x06)
#define READ_SADRH (0x08)
#define READ_EADR0 (0x0A)
#define READ_EADR1 (0x0C)
#define READ_EADR2 (0x0E)
#define READ_EADR3 (0x10)
#define READ_EADR4 (0x12)
#define READ_EADR5 (0x14)
#define READ_EADR6 (0x16)
#define READ_EADR7 (0x18)
#define READ_RXFLUSH (0x1a)
#define READ_ORDER (0x20)
#define READ_TXMCR (0x22)
#define READ_ACKTMOUT (0x24)
#define READ_ESLOTG1 (0x26)
#define READ_SYMTICKL (0x28)
#define READ_SYMTICKH (0x2A)
#define READ_PACON0 (0x2C)
#define READ_PACON1 (0x2E)
#define READ_PACON2 (0x30)
#define READ_TXBCON0 (0x34)
#define READ_TXNCON (0x36)
#define READ_TXG1CON (0x38)
#define READ_TXG2CON (0x3A)
#define READ_ESLOTG23 (0x3C)
#define READ_ESLOTG45 (0x3E)
#define READ_ESLOTG67 (0x40)
#define READ_TXPEND (0x42)
#define READ_WAKECON (0x44)
#define READ_FRMOFFSET (0x46)
#define READ_TXSTAT (0x48)
#define READ_TXBCON1 (0x4A)
#define READ_GATECLK (0x4C)
#define READ_TXTIME (0x4E)
#define READ_HSYMTMRL (0x50)
#define READ_HSYMTMRH (0x52)
#define READ_SOFTRST (0x54)
#define READ_SECON0 (0x58)
#define READ_SECON1 (0x5A)
#define READ_TXSTBL (0x5C)
#define READ_RXSR (0x60)
#define READ_INTSTAT (0x62)
#define READ_INTCON (0x64)
#define READ_GPIO (0x66)
#define READ_TRISGPIO (0x68)
#define READ_SLPACK (0x6A)
#define READ_RFCTL (0x6C)
#define READ_SECCR2 (0x6E)
#define READ_BBREG0 (0x70)
#define READ_BBREG1 (0x72)
#define READ_BBREG2 (0x74)
#define READ_BBREG3 (0x76)
#define READ_BBREG4 (0x78)
#define READ_BBREG6 (0x7C)
#define READ_CCAEDTH (0x7E)
//short address registers for writing
#define WRITE_RXMCR (0x01)
#define WRITE_PANIDL (0x03)
#define WRITE_PANIDH (0x05)
#define WRITE_SADRL (0x07)
#define WRITE_SADRH (0x09)
#define WRITE_EADR0 (0x0B)
#define WRITE_EADR1 (0x0D)
#define WRITE_EADR2 (0x0F)
#define WRITE_EADR3 (0x11)
#define WRITE_EADR4 (0x13)
#define WRITE_EADR5 (0x15)
#define WRITE_EADR6 (0x17)
#define WRITE_EADR7 (0x19)
#define WRITE_RXFLUSH (0x1B)
#define WRITE_ORDER (0x21)
#define WRITE_TXMCR (0x23)
#define WRITE_ACKTMOUT (0x25)
#define WRITE_ESLOTG1 (0x27)
#define WRITE_SYMTICKL (0x29)
#define WRITE_SYMTICKH (0x2B)
#define WRITE_PACON0 (0x2D)
#define WRITE_PACON1 (0x2F)
#define WRITE_PACON2 (0x31)
#define WRITE_TXBCON0 (0x35)
#define WRITE_TXNCON (0x37)
#define WRITE_TXG1CON (0x39)
#define WRITE_TXG2CON (0x3B)
#define WRITE_ESLOTG23 (0x3D)
#define WRITE_ESLOTG45 (0x3F)
#define WRITE_ESLOTG67 (0x41)
#define WRITE_TXPEND (0x43)
#define WRITE_WAKECON (0x45)
#define WRITE_FRMOFFSET (0x47)
#define WRITE_TXSTAT (0x49)
#define WRITE_TXBCON1 (0x4B)
#define WRITE_GATECLK (0x4D)
#define WRITE_TXTIME (0x4F)
#define WRITE_HSYMTMRL (0x51)
#define WRITE_HSYMTMRH (0x53)
#define WRITE_SOFTRST (0x55)
#define WRITE_SECCON0 (0x59)
#define WRITE_SECCON1 (0x5B)
#define WRITE_TXSTBL (0x5D)
#define WRITE_RXSR (0x61)
#define WRITE_INTSTAT (0x63)
#define WRITE_INTCON (0x65)
#define WRITE_GPIO (0x67)
#define WRITE_TRISGPIO (0x69)
#define WRITE_SLPACK (0x6B)
#define WRITE_RFCTL (0x6D) //0x36
#define WRITE_SECCR2 (0x6F)
#define WRITE_BBREG0 (0x71)
#define WRITE_BBREG1 (0x73)
#define WRITE_BBREG2 (0x75)
#define WRITE_BBREG3 (0x77)
#define WRITE_BBREG4 (0x79)
#define WRITE_BBREG6 (0x7D)
#define WRITE_CCAEDTH (0x7F)
#define CHANNEL_11 0x00
#define CHANNEL_12 0x10
#define CHANNEL_13 0x20
#define CHANNEL_14 0x30
#define CHANNEL_15 0x40
#define CHANNEL_16 0x50
#define CHANNEL_17 0x60
#define CHANNEL_18 0x70
#define CHANNEL_19 0x80
#define CHANNEL_20 0x90
#define CHANNEL_21 0xa0
#define CHANNEL_22 0xb0
#define CHANNEL_23 0xc0
#define CHANNEL_24 0xd0
#define CHANNEL_25 0xe0
#define CHANNEL_26 0xf0
void MRF24J40Init(void);
void SetChannel(unsigned char channel);
//unsigned char PHYGetShortRAMAddr(unsigned char address);
//void PHYSetShortRAMAddr(unsigned char address, unsigned char value);
//unsigned char PHYGetLongRAMAddr(unsigned char address);
//void PHYSetLongRAMAddr(unsigned char address, unsigned char value);
//void PHYSetDeviceAddress(WORD PANID, WORD shortAddress);
void Send_Packet(unsigned char Packet_Type);
unsigned char RSSIlookup(unsigned char RSSIval);
#endif
不明白的是,明明已经定义了,编译器就死命说没有定义。。。。。。头大呀!!!!!!!!!!!!!!!
一周热门 更多>