好的,所以我最终设置了PIC16F1618,以便能够使用调试器而不是没有它的PIC16F690。我做了如下的改变:PIC16F690 PIC16F1618SSPATAT SSP1STATSSPCON SSP1CON1ANSEL ANSELLANSELH ANSELB ANSECLSO而不是SSPSTAT,我用SSP1STAT替换它,SSPCON的ITEAD,用安塞尔代替SSP1CON1。0,ANSELH=0,用ASELLA=0,ANSELB=0,ANSELC=0代替。除了SDO以外,该引脚似乎是相同的,我不确定它是基于数据表的,它没有真正理解,所以我留下了它。这可能是个问题,但是SDO在哪里呢?我现在取代了PrimMA的主从微Micro://Copy1 PrimaAcOfC/FoCc=ItoSc//振荡器选择位-& gt;iToSc振荡器:在ClKin PIN上的I/O函数,PrWATE配置,pWRTE=关闭/ /上电定时器启用-&;CSET选择(MCLR/VPP引脚功能是数字输入){ PrimaMac配置=OF//FLASH程序存储器代码保护-&程序存储器代码保护被禁用} PrimaMaMatg配置BRONE = //Brown out RESET使能->Brown out RESET使能的γ-PrAPMA配置CLKOUTEN = OF//时钟输出使能-GT;CLK。输出函数已禁用。在ClkOUT PI///XY-PracMA配置IIOS= ON//内部/外部切换-G&T;内部外部切换模式下启用//OXY-PRADMA配置FCMANN = / /故障安全时钟监视器启用-GT;故障安全时钟监视器启用//CONT2ApRAPMA配置WRT=OF//FLASHMORY自写保护-GT;写保护OFF TraceMac配置PPS1WORE = /OF//外围PIN选择单向控制-gt;PPSLIK位可以通过软件μ-PrimaAcFig ZCD= Off//0-叉检测禁用位-GT;ZCD禁用来重复设置和清除。ZCD可以通过设置ZCDCONα-PracMon配置文件PLLEN=OF//PLL允许位-GT;4x PLL始终启用Underflow、PrimaTracMon配置STVLUN=OF//堆栈溢出/下溢复位允许->堆栈溢出或将导致复位Syr PracMA配置BRV=Lo//Brown out复位电压S。选择-GT;Brown out重置电压(VBOR),低跳闸点选择.Y.PrimaMac配置文件LPBOR=ON//Low Power Brown out RESET & GT;Low Power BOR是启用的。= WDTCPS1F//WDT周期选择-&软件控制(WDTPs),γ-PrAPMA配置,WDTE = OF//看门狗定时器启用-&WT禁用的γ-PracMA配置文件WDTCWS=WDTCWSSW//WDT窗口选择-&软件WDT窗口大小控制(WDTWS位)α-PrAPMA CONFIG WDTTCS = SWC//WDT输入时钟选择器-GT;软件控件,由WDTCS bitsNow控制,当进入调试主项目时,每个表都设置为0:SSP1STAT:BF=0CKe0SMP= 0SSP1CON1:SSPM=0CKP= 0SSPV= 0SSSPUFF=0i没有设置断点,并且设置它不会修复当前问题。看起来像SPIHandler,C和斯皮德勒。H实际上不被用于斯皮德勒。H被包括在内!我知道我的照片正在闪亮,因为这两个LED正在打开。有什么办法解决这个问题吗?
以上来自于百度翻译
以下为原文
OK, so I finally setup the pic16f1618 to be able to use the debugger instead of the pic16f690 which didn't have it. I did the following changes:
PIC16F690 PIC16F1618
SSPSTAT SSP1STAT
SSPCON SSP1CON1
ANSEL ANSELA
ANSELH ANSELB
ANSELC
So instead of SSPSTAT, I replaced it with SSP1STAT.
Intead of SSPCON, I replaced it with SSP1CON1
Instead of ANSEL = 0, ANSELH = 0, I replaced with ANSELA = 0, ANSELB = 0, and ANSELC = 0.
The pinout seemed the same except SDO which I wasn't sure where it belongs based on datasheet, didn't really understand OUT, so I left it the same. This could be a problem, but where is SDO then?
I replaced the pragma's with this now for both master and slave micro's:
// CONFIG1
#pragma config FOSC = INTOSC // Oscillator Selection Bits->INTOSC oscillator: I/O function on CLKIN pin
#pragma config PWRTE = OFF // Power-up Timer Enable->PWRT disabled
#pragma config MCLRE = OFF // MCLR Pin Function Select (MCLR/VPP pin function is digital input)
#pragma config CP = OFF // Flash Program Memory Code Protection->Program memory code protection is disabled
#pragma config BOREN = ON // Brown-out Reset Enable->Brown-out Reset enabled
#pragma config CLKOUTEN = OFF // Clock Out Enable->CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin
//#pragma config IESO = ON // Internal/External Switch Over->Internal External Switch Over mode is enabled
//#pragma config FCMEN = ON // Fail-Safe Clock Monitor Enable->Fail-Safe Clock Monitor is enabled
// CONFIG2
#pragma config WRT = OFF // Flash Memory Self-Write Protection->Write protection off
#pragma config PPS1WAY = OFF // Peripheral Pin Select one-way control->The PPSLOCK bit can be set and cleared repeatedly by software
#pragma config ZCD = OFF // Zero Cross Detect Disable Bit->ZCD disable. ZCD can be enabled by setting the ZCDSEN bit of ZCDCON
#pragma config PLLEN = OFF // PLL Enable Bit->4x PLL is always enabled
#pragma config STVREN = OFF // Stack Overflow/Underflow Reset Enable->Stack Overflow or Underflow will cause a Reset
#pragma config BORV = LO // Brown-out Reset Voltage Selection->Brown-out Reset Voltage (Vbor), low trip point selected.
#pragma config LPBOR = ON // Low-Power Brown Out Reset->Low-Power BOR is enabled
#pragma config LVP = OFF // Low-Voltage Programming Enable->High-voltage on MCLR/VPP must be used for programming
// CONFIG3
#pragma config WDTCPS = WDTCPS1F // WDT Period Select->Software Control (WDTPS)
#pragma config WDTE = OFF // Watchdog Timer Enable->WDT disabled
#pragma config WDTCWS = WDTCWSSW // WDT Window Select->Software WDT window size control (WDTWS bits)
#pragma config WDTCCS = SWC // WDT Input Clock Selector->Software control, controlled by WDTCS bits
Now, every register is set to 0 according to watches when going into debug main project:
SSP1STAT:
BF = 0
CKE = 0
SMP = 0
SSP1CON1:
SSPM = 0
CKP = 0
SSPOV = 0
SSPBUF = 0
I haven't set up a breakpoint and setting it up won't fix my current problem. It seems like SPIHandler.c and SPIHandler.h aren't really being used for SPIHandler.h is being included! I know my pic is being flash properly because both LED's are turning on. Any idea of how to fix this?