カテゴリ:カテゴリ未分類
PSOC DA8を実験、プログラム内容は5V出力を出す。変数idを0-254の範囲で出力を0-5Vにできます。変数はintでBYTEではだめです。 注意するところはGlobal ResourcesのVC1=SysClk/Nを16位にする事、1では出力が2.2V MAXでした。さらに注意するところはRef Muxです。Ref Muxは[Vdd/2]+/-[Vdd/2]にしなければなりません。他の設定では目的の出力になりません。 //----------------------------- // C main line //----------------------------- #include // part specific constants and macros #include "PSoCAPI.h" // PSoC API definitions for all User Modules #include #include #include "DAC8_1.h" // part specific constants and macros void main() { int id; unsigned int i = 0; DAC8_1_Start(DAC8_1_FULLPOWER); // power up the DAC id=254; //0-254 DAC8_1_WriteStall(id); // update DAC while(1); //eikyu loop } お気に入りの記事を「いいね!」で応援しよう
|