標題: 單片機DAC0808交流信號實時轉(zhuǎn)換程序Proteus仿真,通過數(shù)碼管顯示 [打印本頁]

作者: aktuan007    時間: 2021-1-29 14:47
標題: 單片機DAC0808交流信號實時轉(zhuǎn)換程序Proteus仿真,通過數(shù)碼管顯示
1.對輸入的交流信號進行實時轉(zhuǎn)換
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. }
復(fù)制代碼

所有資料51hei提供下載:
adc.zip (76.19 KB, 下載次數(shù): 30)






歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1