標(biāo)題: 簡易晶體管圖示儀仿真 [打印本頁]

作者: taotie    時間: 2022-1-28 20:27
標(biāo)題: 簡易晶體管圖示儀仿真
經(jīng)過幾天的努力終于可以在Proteus 8 示波器顯示小功率晶體管輸出特性曲線圖形了
采用數(shù)字電位器生成階梯電壓。在生成每個階梯的同時產(chǎn)生同步信號(占空比%90~95),反向后供鋸齒波產(chǎn)生電路。




程序很簡單:
rem Main.bas file generated by New Project wizard
rem
rem Created:   周五 5月 2022/1/28    TAOTIE
rem Processor: ATmega8
rem Compiler:  BASCOM-AVR簡易晶體管圖示儀仿真
rem Write your code here

$regfile = "m8def.dat"
  $crystal = 8000000
  Dim c As Byte          '通道變量
  Dim X As Byte          '電阻變量
ddrd.7=1
Config Pind.7 = Output

  Config Pinb.2 = Output   '寫入控制
  Config Spi = Hard , Interrupt = Off , Data Order = Msb , Master = Yes , Polarity = Low , Phase = 0 , Clockrate = 128 , Noss = 1
  Spiinit

'調(diào)整各通道滑臂在下方輸出電壓為0v


'頻道0--5循環(huán),上臂A--W電阻值由小變大
Do

  'For C = 0 To 5
'c=0
For x= 0 To 250 Step 25
Pind.7 =0
Waitus 15
Pind.7 =1
Spiout X , 1
  Portb.2 = 0        '寫入
'Spiout c, 1          '寫入通道
Spiout X , 1        '寫入電阻值
Portb.2 = 1       '寫入停止
Pind.7 =1  
Next x
'Waitms 100
  Loop
  End



作者: taotie    時間: 2022-2-3 11:40



作者: gzhdssj    時間: 2024-4-12 22:00
學(xué)習(xí)中,有時間也做塊PCB




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