This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BQ27411-G1: Current not measured correctly when charging

Part Number: BQ27411-G1
Other Parts Discussed in Thread: BQSTUDIO, EV2400

Hello,

We are using the BQ27411-G1A to monitor the SOC of our batteries. We are manually setting all values in ROM. Everything is working fine except the current measured by the fuel gauge when it is charging the batteries.

When discharging, the fuell cell measures with great accuracy the current flowing trough the 10m Ohm resistor. Never the less, when the batteries are charging the fuell cell reports approximately double the current that's flowing through the resistor. We have measured voltage drop across the resistor and also measured the current flowing trough the resistor and comparing it with the value reported by the fuel gauge, yielding the following table:

We tried two different devices with the same results "Equipo A" and "Equipo B". V Bat Tester is the voltage of the batteries reported by a tester, V Bat FG is the Voltage reported by the Fuel Gauge (FG). V R14 is the voltage drop in the 10m Ohm resistor measured with a tester.

As you can see, the FG reports an incorrect value for positive values of current (batteries charging). We are also sure it is reading current incorrectly, because when charging the Remaining Capacity reported by the Fuel Gauge increases to approximately double the design capacity. In the file "serial_20181222_144052_carga.txt" we have monitored the FG behaviour when charging from a full discharge.

12:36:04.502 vipsoft
12:36:04.591 2670 [mV]
12:36:04.591 AVG:111 [mA], STBY:-1 [mA]
12:36:04.592 MAX:-1272 [mA]
12:36:04.629 296 [mW]
12:36:04.630 SOC:1 [%],RM:1 [mAh]
12:36:04.704 FCC:1341 [mAh],SOH:99 %,0x02
12:36:04.704 OFG:00100101,11111000
12:36:04.706 Design Capacity: 1360 mA
12:36:04.818 H:00000001, L:00001111
12:36:04.818 2999 [0.1 Kelvin]
12:36:04.823 
12:38:02.804 vipsoft
12:38:02.900 3276 [mV]
12:38:02.900 AVG:957 [mA], STBY:-1 [mA]
12:38:02.901 MAX:-1272 [mA]
12:38:02.938 3135 [mW]
12:38:02.939 SOC:1 [%],RM:13 [mAh]
12:38:02.976 FCC:1336 [mAh],SOH:99 %,0x02
12:38:03.013 OFG:00100101,11111000
12:38:03.051 Design Capacity: 1360 mA
12:38:03.088 H:00000001, L:00001110
12:38:03.088 3095 [0.1 Kelvin]
12:38:03.090 
12:43:06.457 vipsoft
12:43:06.568 3715 [mV]
12:43:06.568 AVG:1138 [mA], STBY:-1 [mA]
12:43:06.569 MAX:-1272 [mA]
12:43:06.606 4228 [mW]
12:43:06.607 SOC:8 [%],RM:103 [mAh]
12:43:06.643 FCC:1293 [mAh],SOH:99 %,0x02
12:43:06.681 OFG:00100101,11111000
12:43:06.718 Design Capacity: 1360 mA
12:43:06.719 H:00000001, L:00001100
12:43:06.757 3138 [0.1 Kelvin]
12:43:06.758 
12:49:02.334 vipsoft
12:49:02.434 3821 [mV]
12:49:02.434 AVG:1137 [mA], STBY:-1 [mA]
12:49:02.436 MAX:-1272 [mA]
12:49:02.472 4344 [mW]
12:49:02.473 SOC:18 [%],RM:215 [mAh]
12:49:02.509 FCC:1240 [mAh],SOH:99 %,0x02
12:49:02.510 OFG:00100101,11111000
12:49:02.585 Design Capacity: 1360 mA
12:49:02.622 H:00000001, L:00001000
12:49:02.622 3128 [0.1 Kelvin]
12:49:02.624 
12:54:41.832 vipsoft
12:54:41.951 3858 [mV]
12:54:41.951 AVG:1136 [mA], STBY:-1 [mA]
12:54:41.952 MAX:-1272 [mA]
12:54:41.988 4383 [mW]
12:54:41.989 SOC:28 [%],RM:322 [mAh]
12:54:42.026 FCC:1189 [mAh],SOH:99 %,0x02
12:54:42.027 OFG:00100101,11111000
12:54:42.101 Design Capacity: 1360 mA
12:54:42.139 H:00000001, L:00001000
12:54:42.140 3125 [0.1 Kelvin]
12:54:42.141 
12:59:16.506 vipsoft
12:59:16.594 3892 [mV]
12:59:16.594 AVG:1135 [mA], STBY:-1 [mA]
12:59:16.596 MAX:-1272 [mA]
12:59:16.632 4417 [mW]
12:59:16.633 SOC:36 [%],RM:409 [mAh]
12:59:16.669 FCC:1148 [mAh],SOH:99 %,0x02
12:59:16.670 OFG:00100101,11111000
12:59:16.782 Design Capacity: 1360 mA
12:59:16.782 H:00000001, L:00001000
12:59:16.783 3119 [0.1 Kelvin]
12:59:16.784 
13:05:19.485 vipsoft
13:05:19.569 3929 [mV]
13:05:19.569 AVG:1134 [mA], STBY:-1 [mA]
13:05:19.571 MAX:-1272 [mA]
13:05:19.607 4455 [mW]
13:05:19.608 SOC:48 [%],RM:523 [mAh]
13:05:19.644 FCC:1094 [mAh],SOH:99 %,0x02
13:05:19.683 OFG:00100101,11111000
13:05:19.720 Design Capacity: 1360 mA
13:05:19.757 H:00000001, L:00001000
13:05:19.757 3113 [0.1 Kelvin]
13:05:19.759 
13:11:45.425 vipsoft
13:11:45.531 3958 [mV]
13:11:45.531 AVG:1134 [mA], STBY:-1 [mA]
13:11:45.532 MAX:-1272 [mA]
13:11:45.569 4488 [mW]
13:11:45.570 SOC:63 [%],RM:645 [mAh]
13:11:45.606 FCC:1036 [mAh],SOH:99 %,0x02
13:11:45.607 OFG:00100101,11111000
13:11:45.682 Design Capacity: 1360 mA
13:11:45.719 H:00000001, L:00001000
13:11:45.720 3110 [0.1 Kelvin]
13:11:45.721 
13:18:59.576 vipsoft
13:18:59.672 3987 [mV]
13:18:59.672 AVG:1133 [mA], STBY:-1 [mA]
13:18:59.674 MAX:-1272 [mA]
13:18:59.710 4517 [mW]
13:18:59.711 SOC:81 [%],RM:781 [mAh]
13:18:59.747 FCC:972 [mAh],SOH:99 %,0x02
13:18:59.786 OFG:00100101,11111000
13:18:59.822 Design Capacity: 1360 mA
13:18:59.824 H:00000001, L:00001000
13:18:59.860 3105 [0.1 Kelvin]
13:18:59.862 
13:33:44.964 vipsoft
13:33:45.062 4048 [mV]
13:33:45.062 AVG:1132 [mA], STBY:-1 [mA]
13:33:45.063 MAX:-1272 [mA]
13:33:45.100 4582 [mW]
13:33:45.101 SOC:100 [%],RM:1060 [mAh]
13:33:45.137 FCC:1060 [mAh],SOH:99 %,0x02
13:33:45.175 OFG:00100101,11111000
13:33:45.213 Design Capacity: 1360 mA
13:33:45.288 H:00000000, L:00001000
13:33:45.288 3099 [0.1 Kelvin]
13:33:45.289 
13:37:04.367 vipsoft
13:37:04.482 4058 [mV]
13:37:04.482 AVG:1132 [mA], STBY:-1 [mA]
13:37:04.484 MAX:-1272 [mA]
13:37:04.520 4594 [mW]
13:37:04.558 SOC:100 [%],RM:1123 [mAh]
13:37:04.558 FCC:1123 [mAh],SOH:99 %,0x02
13:37:04.596 OFG:00100101,11111000
13:37:04.671 Design Capacity: 1360 mA
13:37:04.671 H:00000000, L:00001000
13:37:04.672 3098 [0.1 Kelvin]
13:37:04.673 
13:47:25.344 vipsoft
13:47:25.429 4090 [mV]
13:47:25.429 AVG:1130 [mA], STBY:-1 [mA]
13:47:25.431 MAX:-1272 [mA]
13:47:25.467 4622 [mW]
13:47:25.468 SOC:100 [%],RM:1318 [mAh]
13:47:25.505 FCC:1318 [mAh],SOH:99 %,0x02
13:47:25.580 OFG:00100101,11111000
13:47:25.581 Design Capacity: 1360 mA
13:47:25.617 H:00000000, L:00001000
13:47:25.618 3089 [0.1 Kelvin]
13:47:25.619 
13:55:45.942 vipsoft
13:55:46.042 4107 [mV]
13:55:46.042 AVG:1131 [mA], STBY:-1 [mA]
13:55:46.043 MAX:-1272 [mA]
13:55:46.079 4645 [mW]
13:55:46.081 SOC:100 [%],RM:1475 [mAh]
13:55:46.117 FCC:1475 [mAh],SOH:99 %,0x02
13:55:46.155 OFG:00100101,11111000
13:55:46.193 Design Capacity: 1360 mA
13:55:46.229 H:00000000, L:00001000
13:55:46.230 3090 [0.1 Kelvin]
13:55:46.231 
14:07:52.660 vipsoft
14:07:52.773 4154 [mV]
14:07:52.773 AVG:1130 [mA], STBY:-1 [mA]
14:07:52.776 MAX:-1272 [mA]
14:07:52.811 4694 [mW]
14:07:52.812 SOC:100 [%],RM:1703 [mAh]
14:07:52.848 FCC:1703 [mAh],SOH:99 %,0x02
14:07:52.924 OFG:00100101,11111000
14:07:52.961 Design Capacity: 1360 mA
14:07:52.962 H:00000000, L:00001000
14:07:52.962 3083 [0.1 Kelvin]
14:07:52.964 
14:13:21.286 vipsoft
14:13:21.378 4191 [mV]
14:13:21.378 AVG:791 [mA], STBY:-1 [mA]
14:13:21.379 MAX:-1272 [mA]
14:13:21.415 3315 [mW]
14:13:21.417 SOC:100 [%],RM:1799 [mAh]
14:13:21.453 FCC:1799 [mAh],SOH:99 %,0x02
14:13:21.491 OFG:00100101,11111000
14:13:21.529 Design Capacity: 1360 mA
14:13:21.565 H:00000000, L:00001000
14:13:21.566 3067 [0.1 Kelvin]
14:13:21.567 
14:15:51.792 vipsoft
14:15:51.937 4199 [mV]
14:15:51.937 AVG:549 [mA], STBY:-1 [mA]
14:15:51.937 MAX:-1272 [mA]
14:15:51.938 2305 [mW]
14:15:51.939 SOC:100 [%],RM:1827 [mAh]
14:15:51.974 FCC:1827 [mAh],SOH:99 %,0x02
14:15:52.013 OFG:00100101,11111000
14:15:52.050 Design Capacity: 1360 mA
14:15:52.087 H:00000000, L:00001000
14:15:52.088 3051 [0.1 Kelvin]
14:15:52.089 
14:17:08.046 vipsoft
14:17:08.135 4202 [mV]
14:17:08.135 AVG:458 [mA], STBY:-1 [mA]
14:17:08.136 MAX:-1272 [mA]
14:17:08.172 1925 [mW]
14:17:08.174 SOC:100 [%],RM:1837 [mAh]
14:17:08.210 FCC:1837 [mAh],SOH:99 %,0x02
14:17:08.248 OFG:00100101,11111000
14:17:08.286 Design Capacity: 1360 mA
14:17:08.322 H:00000000, L:00001000
14:17:08.323 3039 [0.1 Kelvin]
14:17:08.324 
14:19:46.747 vipsoft
14:19:46.869 4206 [mV]
14:19:46.869 AVG:325 [mA], STBY:-1 [mA]
14:19:46.870 MAX:-886 [mA]
14:19:46.906 1367 [mW]
14:19:46.907 SOC:100 [%],RM:1855 [mAh]
14:19:46.944 FCC:1855 [mAh],SOH:99 %,0x02
14:19:46.945 OFG:00100101,11111000
14:19:47.019 Design Capacity: 1360 mA
14:19:47.057 H:00000010, L:00001000
14:19:47.057 3027 [0.1 Kelvin]
14:19:47.058 
14:21:25.893 vipsoft
14:21:25.979 4208 [mV]
14:21:25.979 AVG:266 [mA], STBY:-1 [mA]
14:21:25.980 MAX:-886 [mA]
14:21:26.016 1119 [mW]
14:21:26.017 SOC:100 [%],RM:1863 [mAh]
14:21:26.054 FCC:1863 [mAh],SOH:99 %,0x02
14:21:26.092 OFG:00100101,11111000
14:21:26.130 Design Capacity: 1360 mA
14:21:26.205 H:00000010, L:00001000
14:21:26.206 3021 [0.1 Kelvin]
14:21:26.206 
14:23:40.639 vipsoft
14:23:40.750 4210 [mV]
14:23:40.750 AVG:209 [mA], STBY:-1 [mA]
14:23:40.752 MAX:-886 [mA]
14:23:40.788 880 [mW]
14:23:40.789 SOC:100 [%],RM:1872 [mAh]
14:23:40.825 FCC:1872 [mAh],SOH:99 %,0x02
14:23:40.864 OFG:00100101,11111000
14:23:40.900 Design Capacity: 1360 mA
14:23:40.902 H:00000010, L:00001000
14:23:40.977 3012 [0.1 Kelvin]
14:23:40.978 
14:25:28.510 vipsoft
14:25:28.598 4211 [mV]
14:25:28.598 AVG:180 [mA], STBY:-1 [mA]
14:25:28.599 MAX:-886 [mA]
14:25:28.636 758 [mW]
14:25:28.637 SOC:100 [%],RM:1877 [mAh]
14:25:28.673 FCC:1877 [mAh],SOH:99 %,0x02
14:25:28.711 OFG:00100101,11111000
14:25:28.748 Design Capacity: 1360 mA
14:25:28.749 H:00000010, L:00001000
14:25:28.786 3008 [0.1 Kelvin]
14:25:28.787 
14:27:54.095 vipsoft
14:27:54.207 4211 [mV]
14:27:54.207 AVG:144 [mA], STBY:-1 [mA]
14:27:54.208 MAX:-886 [mA]
14:27:54.244 606 [mW]
14:27:54.246 SOC:100 [%],RM:1884 [mAh]
14:27:54.282 FCC:1884 [mAh],SOH:99 %,0x02
14:27:54.320 OFG:00100101,11111000
14:27:54.357 Design Capacity: 1360 mA
14:27:54.358 H:00000010, L:00001000
14:27:54.396 3003 [0.1 Kelvin]
14:27:54.396 
14:30:21.388 vipsoft
14:30:21.503 4212 [mV]
14:30:21.503 AVG:119 [mA], STBY:-1 [mA]
14:30:21.505 MAX:-886 [mA]
14:30:21.541 501 [mW]
14:30:21.542 SOC:100 [%],RM:1889 [mAh]
14:30:21.578 FCC:1889 [mAh],SOH:99 %,0x02
14:30:21.617 OFG:00100101,11111000
14:30:21.692 Design Capacity: 1360 mA
14:30:21.692 H:00000010, L:00001000
14:30:21.693 2999 [0.1 Kelvin]
14:30:21.695 
14:32:16.915 vipsoft
14:32:17.000 4212 [mV]
14:32:17.000 AVG:106 [mA], STBY:-1 [mA]
14:32:17.001 MAX:-886 [mA]
14:32:17.038 446 [mW]
14:32:17.039 SOC:100 [%],RM:1893 [mAh]
14:32:17.113 FCC:1893 [mAh],SOH:99 %,0x02
14:32:17.115 OFG:00100101,11111000
14:32:17.150 Design Capacity: 1360 mA
14:32:17.151 H:00000010, L:00001000
14:32:17.188 2998 [0.1 Kelvin]
14:32:17.226 
14:34:45.366 vipsoft
14:34:45.459 4205 [mV]
14:34:45.459 AVG:0 [mA], STBY:-1 [mA]
14:34:45.460 MAX:-886 [mA]
14:34:45.497 0 [mW]
14:34:45.497 SOC:100 [%],RM:1896 [mAh]
14:34:45.535 FCC:1896 [mAh],SOH:99 %,0x02
14:34:45.572 OFG:00100101,11111000
14:34:45.573 Design Capacity: 1360 mA
14:34:45.647 H:00000010, L:00001000
14:34:45.648 2990 [0.1 Kelvin]
14:34:45.649 
14:36:26.774 vipsoft
14:36:26.894 4198 [mV]
14:36:26.894 AVG:0 [mA], STBY:-1 [mA]
14:36:26.896 MAX:-886 [mA]
14:36:26.932 0 [mW]
14:36:26.932 SOC:100 [%],RM:2316 [mAh]
14:36:26.970 FCC:1334 [mAh],SOH:99 %,0x02
14:36:27.007 OFG:00100101,11111000
14:36:27.008 Design Capacity: 1360 mA
14:36:27.082 H:00000010, L:00001000
14:36:27.083 2986 [0.1 Kelvin]
14:36:27.084 
14:38:30.674 vipsoft
14:38:30.791 4192 [mV]
14:38:30.791 AVG:0 [mA], STBY:-1 [mA]
14:38:30.793 MAX:-886 [mA]
14:38:30.829 0 [mW]
14:38:30.829 SOC:100 [%],RM:2316 [mAh]
14:38:30.867 FCC:1334 [mAh],SOH:99 %,0x02
14:38:30.904 OFG:00100101,11111000
14:38:30.905 Design Capacity: 1360 mA
14:38:30.979 H:00000010, L:00001000
14:38:30.979 2985 [0.1 Kelvin]
14:38:30.981 
14:40:41.226 vipsoft
14:40:41.325 4187 [mV]
14:40:41.325 AVG:0 [mA], STBY:-1 [mA]
14:40:41.327 MAX:-886 [mA]
14:40:41.363 0 [mW]
14:40:41.363 SOC:100 [%],RM:2316 [mAh]
14:40:41.401 FCC:1334 [mAh],SOH:99 %,0x02
14:40:41.438 OFG:00100101,11111000
14:40:41.439 Design Capacity: 1360 mA
14:40:41.515 H:00000010, L:00001000
14:40:41.516 2985 [0.1 Kelvin]
14:40:41.516 

We are using two Li-Ion 3.7V 680mAh batteries connected in parallel. Here are the schematics of our design regarding the Fuel Gauge:

Also, with this function we are writing the values configured in ROM:

void fg_write_data_memory2 (void) {
unsigned char uc;
int cs;
fg_write(0x00, 0x00); // UNSEAL
fg_write(0x01, 0x80);
fg_write(0x00, 0x00);
fg_write(0x01, 0x80);
fg_write(0x00, 0x13); // SET_CFGUPDATE
fg_write(0x01, 0x00);
uc = fg_read_unsigned_byte(0x06);

while ((uc & 0x10) == 0) {
_delay_ms(100);
uc = fg_read_unsigned_byte(0x06);
}

fg_write(FG_BLOCKDATACONTROL, 0x00); // BlockDataControl
cs = 0;
fg_class(2); // safety
fg_block(0);
cs = fg_write_data_word(0, 550, cs);
cs = fg_write_data_word(2, 0, cs);
cs = fg_write_data_byte(4, 50, cs);
fg_checksum_write(~cs);
//
fg_class(36); // charge termination
fg_block(0);
cs = fg_write_data_word(0, 25, cs);
cs = fg_write_data_byte(2, 40, cs);
cs = fg_write_data_byte(3, 99, cs);
cs = fg_write_data_byte(4, 95, cs);
cs = fg_write_data_byte(5, -1, cs);
cs = fg_write_data_byte(6, 98, cs);
cs = fg_write_data_word(7, 50, cs);
fg_checksum_write(~cs);
//
fg_class(48); // data
fg_block(0);
cs = fg_write_data_byte_dummy();
cs = fg_write_data_byte(2, -13, cs); // not default
cs = fg_write_data_word(3, -500, cs); // not default
fg_checksum_write(~cs);
//
fg_class(49); // discharge
fg_block(0);
cs = fg_write_data_byte(0, 10, cs);
cs = fg_write_data_byte(1, 15, cs);
cs = fg_write_data_byte(2, 2, cs);
cs = fg_write_data_byte(3, 5, cs);
fg_checksum_write(~cs);
//
fg_class(64); // registers
fg_block(0);
cs = fg_write_data_word(0, 0x25F8, cs);
cs = fg_write_data_byte(2, 0x0F, cs);
cs = fg_write_data_byte(3, 0x80, cs);
fg_checksum_write(~cs);
//
fg_class(68); // power
fg_block(0);
cs = fg_write_data_byte_dummy();
cs = fg_write_data_word(7, 3, cs);
cs = fg_write_data_word(9, 2800, cs);
cs = fg_write_data_byte(11, 1, cs);
fg_checksum_write(~cs);
//
fg_class(80); // IT cfg
fg_block(0);
cs = fg_write_data_byte_dummy();
cs = fg_write_data_word(4, 30, cs);
cs = fg_write_data_byte(10, 8, cs);
cs = fg_write_data_byte(17, 70, cs);
cs = fg_write_data_byte(19, 20, cs);
cs = fg_write_data_byte(20, 5, cs);
cs = fg_write_data_word(22, 800, cs);
cs = fg_write_data_byte(28, 10, cs);
fg_checksum_write(~cs);
//
fg_block(1);
cs = fg_write_data_byte_dummy();
cs = fg_write_data_byte(35, 92, cs);
cs = fg_write_data_byte(36, 96, cs);
cs = fg_write_data_word(37, 125, cs);
cs = fg_write_data_word(39, 4, cs);
cs = fg_write_data_byte(41, 3, cs);
cs = fg_write_data_byte(42, 25, cs);
cs = fg_write_data_byte(44, 15, cs);
cs = fg_write_data_byte(45, 20, cs);
cs = fg_write_data_word(48, 500, cs);
cs = fg_write_data_word(52, 0, cs);
cs = fg_write_data_word(54, 0, cs);
cs = fg_write_data_byte(59, 1, cs);
cs = fg_write_data_byte(60, 20, cs);
cs = fg_write_data_word(61, 11, cs);
fg_checksum_write(~cs);
//
fg_block(2);
cs = fg_write_data_byte_dummy();
cs = fg_write_data_word(70, 0, cs);
cs = fg_write_data_word(72, 200, cs);
cs = fg_write_data_word(74, 100, cs);
cs = fg_write_data_byte(76, 2, cs);
fg_checksum_write(~cs);
//
fg_class(81); // Current Thresholds
fg_block(0);
cs = fg_write_data_word(0, 167, cs);
cs = fg_write_data_word(2, 100, cs);
cs = fg_write_data_word(4, 250, cs);
cs = fg_write_data_word(6, 60, cs);
cs = fg_write_data_byte(8, 60, cs);
cs = fg_write_data_byte(9, 1, cs);
cs = fg_write_data_byte(10, 179, cs);
cs = fg_write_data_byte(11, 179, cs);
cs = fg_write_data_word(12, 400, cs);
fg_checksum_write(~cs);
//
fg_class(82); // State
fg_block(0);
cs = fg_write_data_byte_dummy();
cs = fg_write_data_word(0, 16384, cs); // error here
cs = fg_write_data_byte(2, 0x00, cs);
cs = fg_write_data_word(3, 0, cs); // ?
cs = fg_write_data_byte(5, 0x81, cs);
cs = fg_write_data_word(6, 3803, cs);
cs = fg_write_data_word(8, 3752, cs);
cs = fg_write_data_word(10, 1360, cs); // Design Capacity 680+680 mAh 
cs = fg_write_data_word(12, 5032, cs); // Design Energy 1360 mAh * 3.7 V
cs = fg_write_data_word(14, 1340, cs);
cs = fg_write_data_word(16, 3200, cs); // Terminate Voltage 3200 mV
cs = fg_write_data_byte(26, 1, cs);
cs = fg_write_data_word(27, 25, cs); // Tapper rate = 10*1032/Charge_current
cs = fg_write_data_word(29, 4100, cs);
cs = fg_write_data_byte(31, 10, cs); // Sleep current
fg_checksum_write(~cs);
//
fg_block(1);
cs = fg_write_data_byte_dummy();
cs = fg_write_data_word(33, 4190, cs); // error ?
cs = fg_write_data_word(35, -50, cs);
cs = fg_write_data_word(37, -50, cs);
cs = fg_write_data_word(39, 1, cs);
fg_checksum_write(~cs);
//
fg_class(104); // Data
fg_block(0);
cs = fg_write_data_byte_dummy();
cs = fg_write_data_byte(0, 0, cs);
cs = fg_write_data_byte(1, 0, cs);
cs = fg_write_data_byte(2, 0, cs);
fg_checksum_write(~cs);


fg_class(107); // Current
fg_block(0);
cs = fg_write_data_byte_dummy();
cs = fg_write_data_byte(1, 5, cs);
fg_checksum_write(~cs);

fg_write(0x00, 0x42); // SOFT_RESET
fg_write(0x01, 0x00);
uc = fg_read_unsigned_byte(0x06);
serial_printf_P(PSTR("flags %02X\n"), uc);
while ((uc & 0x10) != 0) {
_delay_ms(100);
uc = fg_read_unsigned_byte(0x06);
}
uc = fg_read_unsigned_byte(0x06);
serial_printf_P(PSTR("flags %02X\n"), uc);
fg_write(0x00, 0x20); // SEAL
fg_write(0x01, 0x00);
return;
}

Any ideas ?

Thanks, Tomás