Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed SDFileSystem
Diff: ILF.cpp
- Revision:
- 3:639e05fcfa0b
- Parent:
- 1:f6a9410c46d2
- Child:
- 4:24481ebef1c4
--- a/ILF.cpp Wed Jan 19 01:52:33 2022 +0000
+++ b/ILF.cpp Fri Jan 21 08:40:08 2022 +0000
@@ -16,6 +16,9 @@
割込みはP0~P2で可能
シーケンサスタート信号は、回路図「seq_yobi]で対応
+ver1.2.5
+IOP測定値にO.L追加 ±100uA
+
ver1.2.4
ver1.2.3のDEB_EN=0としたもの。
公開用。
@@ -75,6 +78,16 @@
*******************************************************************************/
//
//各種定数
+#define O_L 100 //[uA]電流測定値のオーバーロード値 //ver1.2.5
+/*
+#define CAP 20 //[uF] 積分回路のコンデンサ容量
+#define TIME_INT 2 //[s]積分時間
+#define GAIN_I 0.2 //電流測定プリアンプのGAIN
+#define LSB_I 0.00025 //[V] MCP3424 LSB size of 14bit conversion rate setting
+#define MINCODE_I -8192 //Minimum output code of MCP3424
+#define MAXCODE_I 8191 //Maximum output code of MCP3424
+#define GAIN_V 0.2 //電流測定プリアンプのGAIN
+*/
#define DEB_EN 0 //デバッグイネーブル:1 ディスイネーブル:0 ver1.2.3
#define RL_EN 1 //1:io[]を外付けのリードリレー制御用に使用する場合は1.以外は0. ver1.2.3
#define SEQ_EN 0 //1:シーケンサ接続仕様 0:シーケンサ未接続仕様
@@ -108,7 +121,7 @@
//ver1.2.0
const int version_major = 1; //ソフトバージョン
const int version_minor = 2; //ソフトバージョン
-const int version_build = 4; //ソフトバージョン
+const int version_build = 5; //ソフトバージョン
//
//繰り返しタイマー割り込み
@@ -275,7 +288,7 @@
int Jyushin; //受信成功時 Jyushin=0
int Soushin; //送信成功時 Soushin=0
const int fixed_adrs = 0x15 << 3; // Address of PCAS08A(EEPROM) 始めの5bit ver1.2.1
-int adrs_eeprom; //slave address ver1.2.1
+int adrs_eeprom; //slave address ver1.2.1
/***************************
MCP3424(ADC)
***************************/
@@ -408,6 +421,24 @@
void read_caliber(cal_info *cal, int num);
void write_caliber_information(cal_info *cal, int num);
+
+/*******************************
+
+ ver1.2.5
+ convert code to Ampare
+
+*******************************
+float cul_ADC(short code){
+
+ float analog_data;
+
+ analog_data = code * LSB_I / GAIN_I / TIME_INT * CAP ;
+
+ return( analog_data );
+
+}
+*/
+
/*******************************
set mode interruptin/degitalin
@@ -3201,9 +3232,21 @@
wdata[3] = (( y / 10 ) % 10 ) + 0x30;
wdata[4] = ( y % 10 ) + 0x30;
- i2c.write(addr_gu, wdata, 5);
-
- gu_print1("uA");
+ //ver1.2.5
+ //i2c.write(addr_gu, wdata, 5);
+ //gu_print1("uA");
+
+ if ( *idata > O_L * -100 && *idata < O_L * 100 ){
+
+ i2c.write(addr_gu, wdata, 5);
+ gu_print1("uA");
+
+ }else{
+
+ gu_print1("O.L");
+
+ }
+ //upto
}