新手请教!对GPIO设置,在debug中Gpio没有变化!#include<pic.h>
#define uint unsigned int
__CONFIG(0x3185);
uint intnum;
void main()
{
TRISIO=0;
GPIO=0X20;
while(1)
{
if(GP5==1)
{
GP0=1;
INTCON=0xc0;
PIE1=0x01;
TMR1L=(65536-50000)%256;
TMR1H=(65536-50000)/256;
T1CON=0X01;
if(intnum==1200)
{
intnum=0;
GP0=0;
}
}
}
}
void interrupt time1()
{
TMR1IF=0;
TMR1L=(65536-50000)%256;
TMR1H=(65536-50000)/256;
intnum++;
GPIO=0X21;
}
|