SeungheeOh 1 year ago
parent
commit
42c8d5d4c0
1 changed files with 20 additions and 12 deletions
  1. 20
    12
      d72042.ino

+ 20
- 12
d72042.ino View File

@@ -245,6 +245,15 @@ void iebus_init()
245 245
     dataWrite1byte(REG_WRITE_CTR,0b00000000); //Exits from standby mode
246 246
     delay(100);
247 247
     dataWrite1byte(REG_WRITE_CTR,0b00010000); //set REENs 
248
+
249
+
250
+    delay(100);
251
+    dataWrite1byte(REG_WRITE_UAR1,0x37); //UAR1
252
+
253
+    delay(100);
254
+    dataWrite1byte(REG_WRITE_UAR2,0x00); //UAR2
255
+
256
+    
248 257
     delay(100);
249 258
     dataWrite1byte(REG_WRITE_CMR,0b01000000); //Lock
250 259
     delay(100);
@@ -256,11 +265,6 @@ void iebus_init()
256 265
         byte tmp = dataRead1byte(REG_READ_STR);
257 266
         Serial.println(tmp,BIN);  
258 267
     }
259
-
260
-
261
-
262
-
263
-
264 268
     {
265 269
         Serial.print("REG_READ_FLG[0b");
266 270
         Serial.print(REG_READ_FLG,BIN);
@@ -269,18 +273,22 @@ void iebus_init()
269 273
         byte tmp = dataRead1byte(REG_READ_FLG);
270 274
         Serial.println(tmp,BIN);  
271 275
     }
272
-
273
-
274 276
     {
275
-        Serial.print("REG_READ_LOR[0b");
277
+        Serial.print("REG_READ_LOR1[0b");
278
+        Serial.print(REG_READ_LOR1,BIN);
279
+        Serial.print("]");
280
+        Serial.print("REG_READ_LOR1: 0x");
281
+        byte tmp = dataRead1byte(REG_READ_LOR1);
282
+        Serial.println(tmp,BIN);  
283
+    }
284
+    {
285
+        Serial.print("REG_READ_LOR2[0b");
276 286
         Serial.print(REG_READ_LOR2,BIN);
277 287
         Serial.print("]");
278 288
         Serial.print("REG_READ_LOR2: 0x");
279 289
         byte tmp = dataRead1byte(REG_READ_LOR2);
280 290
         Serial.println(tmp,BIN);  
281 291
     }
282
-
283
-
284 292
     {
285 293
         Serial.print("REG_READ_RCR[0b");
286 294
         Serial.print(REG_READ_RCR,BIN);
@@ -530,8 +538,8 @@ void dataWrite1byte(char addr , byte data)
530 538
     SPI.transfer(addr&0xf0); // Register Select
531 539
 
532 540
     digitalWrite(CONTROL, LOW);
533
-    Serial.print("sending:");
534
-    Serial.println(data,HEX);
541
+//    Serial.print("sending:");
542
+//    Serial.println(data,HEX);
535 543
     SPI.transfer(data); // read second 8 bits
536 544
     //  Serial.println(data); //0x2
537 545
     digitalWrite(CONTROL, HIGH);