亚博BST-M51开发板,STC89C52,写程序Rebuild时报错:
error C202: 'P5': undefined identifier
代码如下:
#include "reg51.h"
sbit p1_0 = P1 ^ 0;
sbit p3_0 = P3 ^ 0;
sbit p5_0 = P5 ^ 0; //报错
void main(void)
{
while(1)
{
p1_0 = 0;
p3_0 = 0;
p5_0 = 0;
}
}
P1 和 P3都没问题,为什么P5就有问题呢?
原来是想当然了,因为STC89C52这款单片机确实没有P5.