小白,一个简单地中断程序,帮忙看一下哪里错了
时间:10-02
整理:3721RD
点击:
#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
uchar num;
uchar i,j,k;
uchar code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
void main()
{
TMOD=0x01;
TH0=(65536-45872)/256;
TL0=(65536-45872)%256;
EA=1;
ET0=1;
TR0=1;
i=0;
while(1)
{
if(num==20)
{
num=0;
i++;
j=i%10;
k=i/10;
P1=table[j];
P3=table[k];
}
}
}
void T0_time()interrupt 3
{
num=0;
TH0=(65536-45872)/256;
TL0=(65536-45872)%256;
num++;
}
#define uchar unsigned char
#define uint unsigned int
uchar num;
uchar i,j,k;
uchar code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
void main()
{
TMOD=0x01;
TH0=(65536-45872)/256;
TL0=(65536-45872)%256;
EA=1;
ET0=1;
TR0=1;
i=0;
while(1)
{
if(num==20)
{
num=0;
i++;
j=i%10;
k=i/10;
P1=table[j];
P3=table[k];
}
}
}
void T0_time()interrupt 3
{
num=0;
TH0=(65536-45872)/256;
TL0=(65536-45872)%256;
num++;
}
调试没问题,运行时
error 65:access violation at C :0x2F00: no 'execute/read' permission
本人刚学单片机,问题小白,谢谢大家帮忙
void T0_time()interrupt 1
{
TH0=(65536-45872)/256;
TL0=(65536-45872)%256;
num++;
}