91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 202KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-09
  • 語言: 其他
  • 標簽:

資源簡介

數控電源制作資料、各種各樣電源制作大全,數控電源制作資料、各種各樣電源制作大全,數控電源制作資料、各種各樣電源制作大全.

資源截圖

代碼片段和文件信息

/*?vim:?set?sw=8?ts=8?si?:?*/
/*********************************************
*?Author:?Guido?Socher?Copyright:?GPL?
*
*?Digital?analog?conversion?of?channel?ADC0?and?ADC1?in
*?free?running?mode.?
**********************************************/
#include?
//#include?
#include?
#include?
#include?“avr_compat.h“
#include?“dac.h“
#include?“hardware_settings.h“


volatile?static?unsigned?char?channel=0;?
volatile?static?unsigned?char?voltagecontrol=0;?//?0=current?limit?1=voltage?control
volatile?static?uint16_t?conversioncount=0;?//?changed?at?every?conversion
//?adc?measurement?results:
volatile?static?int?analog_result[2];??//?datatype?int?is?16?bit

//?the?value?that?is?requested?(control?loop?calibrates?to?this).
volatile?static?unsigned?int?target_val[2];??//?datatype?int?is?16?bit

static?unsigned?char?adlowadhigh;
static?int?dac_val=0;

/*?You?must?enable?interrupt?with?sei()?in?the?main?program?
?*?before?you?call?init_analog?
?*/
void?init_analog(void)?
{
//?initialize?the?adc?result?to?very?high?values
//?to?keep?the?control-loop?down?until?proper?measurements
//?are?done:
analog_result[0]=0;?
analog_result[1]=1025;?
target_val[0]=0;?//?initialize?to?zero
target_val[1]=0;?//?initialize?to?zero
????????/*?enable?analog?to?digital?conversion?in?free?run?mode
????????*??without?noise?canceler?function.?See?datasheet?of?atmega8?page?195
????????*?We?set?ADPS2=1ADPS1=0ADPS0=1?to?have?a?clock?division?factor?of?32.
????????*?This?is?needed?to?stay?in?the?recommended?range?of?50-200kHz?
????????*?ADEN:?Analog?Digital?Converter?Enable
????????*?ADIE:?ADC?Interrupt?Enable
????????*?ADIF:?ADC?Interrupt?Flag
????????*?ADFR:?ADC?Free?Running?Mode
????????*?ADCSR:?ADC?Control?and?Status?Register
????????*?ADPS2..ADPS0:?ADC?Prescaler?Select?Bits
*?REFS:?Reference?Selection?Bits?(page?203)
????????*/

//?int-ref?with?external?capacitor?at?AREF?pin:?
//?2.56V?int?ref=REFS1=1REFS0=1
//?write?only?the?lower?3?bit?for?channel?selection

//?2.56V?ref?start?with?channel?0
ADMUX=(1<
????????ADCSR=(1<
/*??start?conversion?*/
sbi(ADCSRADSC);
//wait?until?both?channels?are?measured?twice
while(conversioncount?}

int?is_dacval(void)?
{
return(dac_val);
}

signed?char?is_current_limit(void)?
{
//?return?1?if?current?control?loop?active
if?(voltagecontrol==0){
return(1);
}
return(0);
}

/*?set?the?target?adc?value?for?the?control?loop
?*?values?for?item:?0?=?u?1?=?i?units?must?be?of?the?same?as?the?values?
?*?from?the?dac.
?*/
void?set_target_adc_val(unsigned?char?itemunsigned?int?val)?
{
//?here?we?can?directly?write?to?target_val?
target_val[item]=val;
}
/*?get?the?result?of?an?analog?conversion.
?*?The?problem?here?is?that?we?need?to?read?more?than?8?bit.?Therefore
?*?it?will?always?result?in?two?assembler?instruction.?In?other?words
?*?it?is?not?an?atomic?operation.?To?get?i

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????14272??2007-06-26?12:16??數字電源資料\atem8數控電源-PCB.MDI

?????文件??????17694??2007-06-26?12:16??數字電源資料\atem8數控電源元件面.MDI

?????文件??????30882??2007-06-26?12:15??數字電源資料\atem8數控電源電路圖.MDI

?????文件??????18889??2006-03-25?03:36??數字電源資料\ddcp_pre.hex

?????文件?????141795??2007-06-26?11:20??數字電源資料\digital?power.DSN

?????文件??????55898??2007-06-21?09:38??數字電源資料\digital?power.LYT

?????文件??????15656??2007-06-26?11:23??數字電源資料\原版電路圖.pdf

?????目錄??????????0??2007-12-25?09:01??數字電源資料

?????文件???????5006??2007-07-09?01:04??數字電源資料\源程序\analog.c

?????文件????????653??2005-06-26?02:23??數字電源資料\源程序\analog.h

?????文件???????1108??2007-07-10?06:09??數字電源資料\源程序\avr_compat.h

?????文件????????913??2006-01-08?21:46??數字電源資料\源程序\dac.c

?????文件????????375??2005-06-26?02:23??數字電源資料\源程序\dac.h

?????文件???????1505??2007-07-09?00:59??數字電源資料\源程序\hardware_settings.h

?????文件???????1505??2007-07-09?01:18??數字電源資料\源程序\hardware_settings.h.22

?????文件???????1503??2006-07-04?03:02??數字電源資料\源程序\hardware_settings.h.30

?????文件???????2491??2007-07-09?01:28??數字電源資料\源程序\i2c-comm\i2ctalk_linux.c

?????文件???????7287??2007-07-09?01:34??數字電源資料\源程序\i2c-comm\i2c_m.c

?????文件???????1079??2005-06-26?02:23??數字電源資料\源程序\i2c-comm\i2c_m.h

?????文件???????2487??2005-08-05?20:25??數字電源資料\源程序\i2c-comm\i2c_rs232_pintest.c

?????文件??????11655??2007-07-10?06:15??數字電源資料\源程序\i2c-comm\linux_pre\i2ctalk

?????文件??????11259??2006-01-22?20:52??數字電源資料\源程序\i2c-comm\linux_pre\i2c_rs232_pintest

?????文件?????????94??2007-07-10?06:16??數字電源資料\源程序\i2c-comm\linux_pre\md5sum.txt

?????文件????????602??2007-07-09?13:37??數字電源資料\源程序\i2c-comm\Makefile

?????文件??????18160??2005-08-05?18:28??數字電源資料\源程序\i2c-comm\other_OS\macOSX\i2ctalk

?????文件??????18224??2005-08-05?18:28??數字電源資料\源程序\i2c-comm\other_OS\macOSX\i2c_rs232_pintest

?????文件????????108??2005-08-05?18:29??數字電源資料\源程序\i2c-comm\other_OS\macOSX\md5sum.txt

?????文件???????1665??2005-08-05?20:06??數字電源資料\源程序\i2c-comm\other_OS\macOSX\README.txt

?????文件??????11612??2005-08-05?20:05??數字電源資料\源程序\i2c-comm\other_OS\solaris\i2ctalk

?????文件??????12108??2005-08-05?20:05??數字電源資料\源程序\i2c-comm\other_OS\solaris\i2c_rs232_pintest

............此處省略38個文件信息

評論

共有 條評論

相關資源