找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開始

搜索
查看: 2481|回復(fù): 0
收起左側(cè)

單片機(jī)DAC0808交流信號(hào)實(shí)時(shí)轉(zhuǎn)換程序Proteus仿真,通過數(shù)碼管顯示

[復(fù)制鏈接]
ID:582255 發(fā)表于 2021-1-29 14:47 | 顯示全部樓層 |閱讀模式
1.對(duì)輸入的交流信號(hào)進(jìn)行實(shí)時(shí)轉(zhuǎn)換
2.通過LCD進(jìn)行實(shí)時(shí)顯示
3.proteus仿真

仿真原理圖如下(proteus仿真工程文件可到本帖附件中下載)
51hei截圖20210129144433.png

單片機(jī)源程序如下:
  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.png
所有資料51hei提供下載:
adc.zip (76.19 KB, 下載次數(shù): 30)

評(píng)分

參與人數(shù) 1黑幣 +30 收起 理由
admin + 30 共享資料的黑幣獎(jiǎng)勵(lì)!

查看全部評(píng)分

回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

手機(jī)版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表