4个信号脚中,除了CLK脚有波形外,其它信号全部没有!
#include "pic16f688.h"
//******************************************************************************
#define MOSI RA4 //O
#define CS RA5 //O
#define CLK RC3 //O
#define MISO RC5 //I
/*******************************************************************************
IO初始化驱动
********************************************************************************/
void CPUIO_Init(void)
{
OSCCON = 0x71; //8MHz
OSCTUNE = 0x00;
WPUA = 0x00; //porta pull high
IOCA = 0x00; //disable porta pin change interrupt
PIE1 = 0x00;
PIR1 = 0x00;
INTCON = 0x00;
TRISA = 0x00; //0000 1101
PORTA = 0x00;
TRISC = 0x00; //0010 0001
PORTC = 0x00;
ANSEL = 0x00;
CMCON0 = 0x07; //Cmoparator Off
}
/*******************************************************************************
信号调试程序
********************************************************************************/
void main(void)
{
CPUIO_Init();
while(1)
{
PORTA = ~PORTA;
PORTC = ~PORTC;
}
} |