资源描述:
《dac8512输出正弦c程序》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、#include#include#include#include#defineucharunsignedchar#defineuintunsignedintucharan_jian1=0;sbitDAC8512_SCLK=P3^5;//时钟信号输入端sbitDAC8512_SDI=P3^6;//数据输入端sbitDAC8512_LD=P3^7;//低电平有效,数据写入串行数据寄存器sbitkey1=P1^0;uintcodesin_tab[]={2048,2060,2073,2086,2099,2112,
2、2125,2138,2150,2163,2176,2189,2202,2215,2227,2240,2253,2266,2279,2291,2304,2317,2330,2342,2355,2368,2380,2393,2406,2419,2431,2444,2456,2469,2482,2494,2507,2519,2532,2544,2557,2569,2582,2594,2606,2619,2631,2643,2656,2668,2680,2692,2705,2717,2729,2741,2753,2765,2777,2789,2801,2813,2825,2837,28
3、49,2861,2872,2884,2896,2908,2919,2931,2942,2954,2966,2977,2988,3001,3011,3023,3034,3045,3056,3068,3079,3090,3101,3112,3123,3134,3145,3155,3166,3177,3188,3198,3209,3220,3230,3241,3251,3261,3272,3282,3292,3302,3313,3323,3333,3343,3353,3363,3372,3382,3392,3402,3411,3421,3430,3440,3449,3458,3468
4、,3478,3486,3495,3504,3513,3522,3531,3540,3549,3558,3566,3575,3583,3592,3600,3609,3617,3625,3633,3641,3649,3657,3665,3673,3681,3689,3696,3704,3711,3719,3726,3734,3741,3748,3755,3762,3769,3776,3783,3790,3797,3803,3810,3816,3823,3829,3836,3842,3848,3854,3860,3866,3872,3878,3883,3889,3895,3900,3
5、906,3911,3916,3921,3927,3932,3937,3942,3946,3951,3956,3961,3965,3970,3974,3978,3983,3987,3991,3995,3999,4003,4006,4010,4014,4017,4021,4024,4027,4031,4034,4037,4040,4043,4046,4048,4051,4054,4056,4059,4061,4063,4066,4068,4070,4072,4074,4075,4077,4079,4080,4082,4083,4085,4086,4087,4088,4089,409
6、0,4091,4092,4092,4093,4094,4094,4094,4095,4095,4095,4095,4095,4095,4095,4094,4094,4094,4093,4092,4092,4091,4090,4089,4088,4087,4086,4085,4083,4082,4080,4079,4077,4075,4074,4072,4070,4068,4066,4063,4061,4059,4056,4054,4051,4048,4046,4043,4040,4037,4034,4031,4027,4024,4021,4017,4014,4010,4006,
7、4003,3999,3995,3991,3987,3983,3978,3974,3970,3965,3961,3956,3951,3946,3942,3937,3932,3927,3921,3916,3911,3906,3900,3895,3889,3883,3878,3872,3866,3860,3854,3848,3842,3836,3829,3823,3816,3810,3803,3797,3790,3783,3776,3769,3762,3755,3748,3741,3734,372