标题: 单片机DAC0808交流信号实时转换程序Proteus仿真,通过数码管显示 [打印本页]

作者: aktuan007    时间: 2021-1-29 14:47
标题: 单片机DAC0808交流信号实时转换程序Proteus仿真,通过数码管显示
1.对输入的交流信号进行实时转换
2.通过LCD进行实时显示
3.proteus仿真

仿真原理图如下(proteus仿真工程文件可到本帖附件中下载)


单片机源程序如下:
  1. //ICC-AVR application builder : 00-1-16 4:13:00
  2. // Target : 8535
  3. // Crystal: 4.0000Mhz

  4. #include <io8535v.h>
  5. #include <macros.h>
  6. #define uchar unsigned char
  7. #define uint unsigned int
  8. #include <adc.h>
  9. #include <led_dsp.h>
  10. #include <dac.h>



  11. void port_init(void)
  12. {
  13. PORTA = 0x00;
  14. DDRA  = 0x00;
  15. PORTB = 0xFF;
  16. DDRB  = 0xFF;
  17. PORTC = 0x00;
  18. DDRC  = 0xff;
  19. PORTD = 0xF0;
  20. DDRD  = 0x0F;
  21. }


  22. void main (void)
  23. {
  24. uchar i;
  25. //stop errant interrupts until set up
  26. CLI(); //disable all interrupts
  27. port_init();
  28. adc_init();
  29. dac_init ();
  30. MCUCR = 0x00;
  31. GIMSK = 0x00;
  32. SEI(); //re-enable interrupts
  33. //all peripherals are now initialised
  34. while (1)
  35. {
  36.         change_data(adc_val);
  37.          scan_led(disp_buffer);
  38. //         put_to_dac();
  39.         }
  40. }
复制代码

所有资料51hei提供下载:
adc.zip (76.19 KB, 下载次数: 30)






欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1