最近突发奇想,对手头上的mcu芯片进行一个简单的测试 测试内容包括:io口翻转速度,乘法运算速度,单次for循环速度 测试的单片机包括了各大厂商:ST,Ti,STC,ATMEL 测试的mcu内核包括:ARM-M3,ARM-M4,AVR,MSP430,8051 本次测试并非专业测试,结果仅供参考。 测试代码如下:
void chackckack()
{
int x1=23;
int x2=66;
int k=0;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
k=x1*x2;
}
void chackckack10000()
{
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
chackckack();
}
void textgpio()
{
LED0_L;
LED0_H;
LED0_L;
LED0_H;
LED0_L;
LED0_H;
LED0_L;
LED0_H;
LED0_L;
LED0_H;
LED0_L;
LED0_H;
LED0_L;
LED0_H;
LED0_L;
LED0_H;
LED0_L;
LED0_H;
LED0_L;
LED0_H;
LED0_L;
}
void main()
{
int i;
while(1)
{
textgpio()
chackckack10000();
LED0_H;
LED0_L;
for(i=0;i<100;i++);
LED0_H;
LED0_L;
delay_ms(20);
}
}
测试汇总表格在此:
|