各位大虾,16F1823的RC口输出1/0挺正常的,RA口输出就是不正常。
程序在下面,请帮忙看一下哪里问题吧,谢谢
#include <pic.h>
__CONFIG(0x001C);
void Init_Config()
{
OSCCON = 0xFB;
C1ON = 0;
C2ON = 0;
PORTA = 0x00;
LATA = 0x00;
ANSELA = 0x00;
TRISA = 0x00;
PORTC = 0x00;
LATC = 0x00;
ANSELC = 0x00;
TRISC = 0x00;
}
void main()
{
Init_Config();
while(1)
{
asm("clrwdt"); //清看门狗
RA0 = 1;
RA1 = 1;
RA2 = 1;
RA3 = 1;
RA4 = 1;
RA5 = 1;
RA0 = 0;
RA1 = 0;
RA2 = 0;
RA3 = 0;
RA4 = 0;
RA5 = 0;
}
}
|