current
This commit is contained in:
		
							parent
							
								
									630abd209c
								
							
						
					
					
						commit
						42c8d5d4c0
					
				
							
								
								
									
										32
									
								
								d72042.ino
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								d72042.ino
									
									
									
									
									
								
							| @ -245,6 +245,15 @@ void iebus_init() | |||||||
|     dataWrite1byte(REG_WRITE_CTR,0b00000000); //Exits from standby mode
 |     dataWrite1byte(REG_WRITE_CTR,0b00000000); //Exits from standby mode
 | ||||||
|     delay(100); |     delay(100); | ||||||
|     dataWrite1byte(REG_WRITE_CTR,0b00010000); //set REENs 
 |     dataWrite1byte(REG_WRITE_CTR,0b00010000); //set REENs 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     delay(100); | ||||||
|  |     dataWrite1byte(REG_WRITE_UAR1,0x37); //UAR1
 | ||||||
|  | 
 | ||||||
|  |     delay(100); | ||||||
|  |     dataWrite1byte(REG_WRITE_UAR2,0x00); //UAR2
 | ||||||
|  | 
 | ||||||
|  |      | ||||||
|     delay(100); |     delay(100); | ||||||
|     dataWrite1byte(REG_WRITE_CMR,0b01000000); //Lock
 |     dataWrite1byte(REG_WRITE_CMR,0b01000000); //Lock
 | ||||||
|     delay(100); |     delay(100); | ||||||
| @ -256,11 +265,6 @@ void iebus_init() | |||||||
|         byte tmp = dataRead1byte(REG_READ_STR); |         byte tmp = dataRead1byte(REG_READ_STR); | ||||||
|         Serial.println(tmp,BIN);   |         Serial.println(tmp,BIN);   | ||||||
|     } |     } | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|     { |     { | ||||||
|         Serial.print("REG_READ_FLG[0b"); |         Serial.print("REG_READ_FLG[0b"); | ||||||
|         Serial.print(REG_READ_FLG,BIN); |         Serial.print(REG_READ_FLG,BIN); | ||||||
| @ -269,18 +273,22 @@ void iebus_init() | |||||||
|         byte tmp = dataRead1byte(REG_READ_FLG); |         byte tmp = dataRead1byte(REG_READ_FLG); | ||||||
|         Serial.println(tmp,BIN);   |         Serial.println(tmp,BIN);   | ||||||
|     } |     } | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|     { |     { | ||||||
|         Serial.print("REG_READ_LOR[0b"); |         Serial.print("REG_READ_LOR1[0b"); | ||||||
|  |         Serial.print(REG_READ_LOR1,BIN); | ||||||
|  |         Serial.print("]"); | ||||||
|  |         Serial.print("REG_READ_LOR1: 0x"); | ||||||
|  |         byte tmp = dataRead1byte(REG_READ_LOR1); | ||||||
|  |         Serial.println(tmp,BIN);   | ||||||
|  |     } | ||||||
|  |     { | ||||||
|  |         Serial.print("REG_READ_LOR2[0b"); | ||||||
|         Serial.print(REG_READ_LOR2,BIN); |         Serial.print(REG_READ_LOR2,BIN); | ||||||
|         Serial.print("]"); |         Serial.print("]"); | ||||||
|         Serial.print("REG_READ_LOR2: 0x"); |         Serial.print("REG_READ_LOR2: 0x"); | ||||||
|         byte tmp = dataRead1byte(REG_READ_LOR2); |         byte tmp = dataRead1byte(REG_READ_LOR2); | ||||||
|         Serial.println(tmp,BIN);   |         Serial.println(tmp,BIN);   | ||||||
|     } |     } | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|     { |     { | ||||||
|         Serial.print("REG_READ_RCR[0b"); |         Serial.print("REG_READ_RCR[0b"); | ||||||
|         Serial.print(REG_READ_RCR,BIN); |         Serial.print(REG_READ_RCR,BIN); | ||||||
| @ -530,8 +538,8 @@ void dataWrite1byte(char addr , byte data) | |||||||
|     SPI.transfer(addr&0xf0); // Register Select
 |     SPI.transfer(addr&0xf0); // Register Select
 | ||||||
| 
 | 
 | ||||||
|     digitalWrite(CONTROL, LOW); |     digitalWrite(CONTROL, LOW); | ||||||
|     Serial.print("sending:"); | //    Serial.print("sending:");
 | ||||||
|     Serial.println(data,HEX); | //    Serial.println(data,HEX);
 | ||||||
|     SPI.transfer(data); // read second 8 bits
 |     SPI.transfer(data); // read second 8 bits
 | ||||||
|     //  Serial.println(data); //0x2
 |     //  Serial.println(data); //0x2
 | ||||||
|     digitalWrite(CONTROL, HIGH); |     digitalWrite(CONTROL, HIGH); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user