1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ZYBO > XADC Alarmのコードを動かしてみた > temp high alarm / temp low alarmの設定

Last updated at Posted at 2016-06-26

https://forums.xilinx.com/t5/Xcell-Daily-Blog/Adam-Taylor-s-MicroZed-Chronicles-Part-43-XADC-Alarms-and/ba-p/496468
にあるXADCのAlarm関連のコードを試してみた。

Vivado

  1. ZynqのIPを追加後、XADC WizardのIPを追加
  2. Run Block Automation, Run Connection Automationを実施
  3. HDL Wrapper追加後、bit stream作成まで実行

XSDK

blogにあるコードをそのままapplicationとして実装。

実行するとターミナルに以下のような表示が出てきた。

Xcell Daily blog XADC part 43
temp high alarm 42803 Real Temp 56.008606
temp low alarm 40785 Real Temp 40.490021

上記の表示関連のコードは以下の部分。

	TempRawData = XAdcPs_GetAdcData(XADCInstPtr, XADCPS_CH_TEMP);
	TempRawData = TempRawData+0x03FF;
	XAdcPs_SetAlarmThreshold(XADCInstPtr, XADCPS_ATR_TEMP_UPPER,(TempRawData));
	TempData = XAdcPs_RawToTemperature(TempRawData);
	printf("temp high alarm %lu Real Temp %f \n\r", TempRawData, TempData);

	TempRawData = XAdcPs_GetAdcData(XADCInstPtr, XADCPS_CH_TEMP);
	TempRawData = TempRawData-0x03FF;
	XAdcPs_SetAlarmThreshold(XADCInstPtr, XADCPS_ATR_TEMP_LOWER,(TempRawData));
	TempData = XAdcPs_RawToTemperature(TempRawData);
	printf("temp low alarm %lu Real Temp %f \n\r", TempRawData, TempData);

blogには以下の記載がある。

It then assigns an upper and lower temperature alarm based upon the value it has just read.

その時点のADC読取りした値をhigh alarm, low alarmとして設定しているようだ。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?