#include <reg52h>
#include <absacch> //绝对地址访问的头文件
#define DAC0832 XBYTE[0x7fff] //DAC0832地址
unsigned char code sin_tab[] = //正弦波输出表
{
0x7F,0x82,0x85,0x88,0x8B,0x8F,0x92,0x95,0x98,0x9B,0x9E,0xA1,0xA4,0xA7,0xAA,0xAD,
0xB0,0xB3,0xB6,0xB8,0xBB,0xBE,0xC1,0xC3,0xC6,0xC8,0xCB,0xCD,0xD0,0xD2,0xD5,0xD7,
0xD9,0xDB,0xDD,0xE0,0xE2,0xE4,0xE5,0xE7,0xE9,0xEB,0xEC,0xEE,0xEF,0xF1,0xF2,0xF4,
0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFB,0xFC,0xFD,0xFD,0xFE,0xFE,0xFE,0xFE,0xFE,
0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFD,0xFD,0xFC,0xFB,0xFB,0xFA,0xF9,0xF8,0xF7,0xF6,
0xF5,0xF4,0xF2,0xF1,0xEF,0xEE,0xEC,0xEB,0xE9,0xE7,0xE5,0xE4,0xE2,0xE0,0xDD,0xDB,
0xD9,0xD7,0xD5,0xD2,0xD0,0xCD,0xCB,0xC8,0xC6,0xC3,0xC1,0xBE,0xBB,0xB8,0xB6,0xB3,
0xB0,0xAD,0xAA,0xA7,0xA4,0xA1,0x9E,0x9B,0x98,0x95,0x92,0x8F,0x8B,0x88,0x85,0x82,
0x7F,0x7C,0x79,0x76,0x73,0x6F,0x6C,0x69,0x66,0x63,0x60,0x5D,0x5A,0x57,0x54,0x51,
0x4E,0x4B,0x48,0x46,0x43,0x40,0x3D,0x3B,0x38,0x36,0x33,0x31,0x2E,0x2C,0x29,0x27,
0x25,0x23,0x21,0x1E,0x1C,0x1A,0x19,0x17,0x15,0x13,0x12,0x10,0x0F,0x0D,0x0C,0x0A,
0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x03,0x02,0x01,0x01,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x02,0x03,0x03,0x04,0x05,0x06,0x07,0x08,
0x09,0x0A,0x0C,0x0D,0x0F,0x10,0x12,0x13,0x15,0x17,0x19,0x1A,0x1C,0x1E,0x21,0x23,
0x25,0x27,0x29,0x2C,0x2E,0x31,0x33,0x36,0x38,0x3B,0x3D,0x40,0x43,0x46,0x48,0x4B,
0x4E,0x51,0x54,0x57,0x5A,0x5D,0x60,0x63,0x66,0x69,0x6C,0x6F,0x73,0x76,0x79,0x7C
};
char code reserve[3]_at_ 0x3b; //保留0x3b开始的3个字节
/
主函数
/
void main()
{
unsigned int i;
P0=0xff;
P2=0xff;
while(1)
{
for (i = 0; i < 256; i++)
DAC0832 = sin_tab[i];
}
}
工程什么的都已经建立好了,只一个起步,不代表什么的。
51单片机程序编译完后为什么还是显示错误,这不可能,只要有错误,编译就不会完成的。
你程序有错误,不等于编译一遍就对了,不找错误,就是编译一百遍也没有用。
在下不懂汇编只懂C
看了下你的原理图有问题,上拉电阻接法不对,当然实际中你用排阻的话很好接
原理图的画法是:单片机引脚直接和 LED 相连,同时单片机的引脚接电阻再接到 VCC
以上就是关于用keil写51单片机程序出现这个错误 DAC0832.C(28): error C213: left side of asn-op not an lvalue全部的内容,包括:用keil写51单片机程序出现这个错误 DAC0832.C(28): error C213: left side of asn-op not an lvalue、51单片机程序编译完后为什么还是显示错误,工程什么的都已经建立好了。、基于51单片机的摇摇棒汇编程序 求大神帮忙注释与改错,急急急!!!等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)