-uint8_t owid[8]={0x28, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x77, 0x6B};/**/
-uint8_t config_info[16]={0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x10,0x11,0x12,0x13,0x14,0x15,0x16};
+uint8_t owid[8]={0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40};/**/
+uint8_t config_info[16]={0x02,0x03, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
#if (owid>128)
#error "Variable not correct"
uint32_t P;
int32_t t;
bmp280ConvertInt(&t,&P,1);
- P=P*16;
- P=P/1000;
+ P=P-70000;
+ P=P/20;
uint16_t w=P;
uint8_t t8=w>>4;
uint8_t af=0;
uint8_t owid1[8]={0x28, 0xA3, 0xD9, 0x84, 0x00, 0x16, 0x05, 0x18};/**/
-uint8_t owid2[8]={0x26, 0xA2, 0xD9, 0x84, 0x00, 0x00, 0x01, 0x77};/**/
-uint8_t config_info1[16]={0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
-uint8_t config_info2[16]={0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+uint8_t owid2[8]={0x26, 0xA3, 0xD9, 0x84, 0x00, 0x16, 0x05, 0x67};/**/
+uint8_t config_info1[16]={0x03,0x04, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+uint8_t config_info2[16]={0x01,0x06, 0x05,0x00, 0x04,0x07, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
#if (owid>128)
#error "Variable not correct"
uint8_t owid[8]={0x28, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x77, 0x6B};/**/
-uint8_t config_info[16]={0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+uint8_t config_info[16]={0x03,0x04, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
#if (owid>128)
#error "Variable not correct"
hrc_fw_configinfo:
ldi r_mode,OW_FWCONFIGINFO
ldi r_sendflag,1
+ CRCInit2
rjmp h_fwconfiginfo
hrc_fw_configinfo1:
ldi r_mode,OW_FWCONFIGINFO1
ldi r_sendflag,1
+ CRCInit2
rjmp h_fwconfiginfo1
hrc_fw_configinfo2:
ldi r_mode,OW_FWCONFIGINFO2
ldi r_sendflag,1
+ CRCInit2
rjmp h_fwconfiginfo2
brne owinit_odgen2
dec r_bytep
brne owinit_odgen1
+ ;copy ids in config bytes
+ ldi xl,lo8(owid1)
+ ldi xh,hi8(owid1)
+ ldi yl,lo8(config_info2+9)
+ ldi yh,hi8(config_info2+9)
+ ldi r_temp,7
+owinit_cpconfig1:
+ ld r_rwbyte,X+
+ st Y+,r_rwbyte
+ dec r_temp
+ brne owinit_cpconfig1
+ ldi xl,lo8(owid2)
+ ldi xh,hi8(owid2)
+ ldi yl,lo8(config_info1+9)
+ ldi yh,hi8(config_info1+9)
+ ldi r_temp,7
+owinit_cpconfig2:
+ ld r_rwbyte,X+
+ st Y+,r_rwbyte
+ dec r_temp
+ brne owinit_cpconfig2
ldi r_temp,0
pro_read_rom_command:
ldi mode,OWM_SLEEP
- cpi rwbyte,0xCC
- brne pro_rcc_1
- ldi mode,OWM_READ_COMMAND
- rjmp pro_out_bitp1
+ //cpi rwbyte,0xCC
+ //brne pro_rcc_1
+ //ldi mode,OWM_READ_COMMAND
+ //rjmp pro_out_bitp1
pro_rcc_1:
- cpi rwbyte,0xF0
+ cpi rwbyte,0xF0 ;Searchrom
brne pro_rcc_2
ldi XL,low(sowid) ;init sram pointer
ldi XH,high(sowid)
ldi bytep,0
rjmp pro_serchrom_next_bit
pro_rcc_2:
- cpi rwbyte,0x55
+ cpi rwbyte,0x55 ;Matchrom
brne pro_rcc_3
// rcall pro_owidinit
ldi XL,low(sowid) ;init sram pointer
pro_read_command:
ldi mode,OWM_SLEEP
- cpi rwbyte,0x0F
+ cpi rwbyte,0x0F ;; Write to Scratchpad
brne pro_rc_1
ldi mode,OWM_WRITE_SCRATCHPAD
ldi XL,low(scratchpad) ;init sram pointer
pro_rc_1:
cpi rwbyte,0xAA
brne pro_rc_2
- ldi mode,OWM_READ_SCRATCHPAD
+ ldi mode,OWM_READ_SCRATCHPAD ;;Read from Scratchpad
ldi XL,low(scratchpad) ;init sram pointer
ldi XH,high(scratchpad)
inc smode
pro_rc_2:
cpi rwbyte,0xB8
brne pro_rc_3
- ldi mode,OWM_RECALL_FLASH
+ ldi mode,OWM_RECALL_FLASH ;; copy Flash page in Scratchpad
ldi XL,low(scratchpad) ;init sram pointer
ldi XH,high(scratchpad)
rjmp pro_out_bytep0
pro_rc_3:
- cpi rwbyte,0x55
+ cpi rwbyte,0x55 ; copy Scratchpad to Flash
brne pro_rc_4
ldi mode,OWM_SLEEP
rjmp pro_programm_page
pro_rc_4:
- cpi rwbyte,0x89
+ cpi rwbyte,0x89 ; Reset Device /Boot (new) Firmware
brne pro_rc_5
rjmp jreset
pro_rc_5:
- cpi rwbyte,0x8B
+ cpi rwbyte,0x8B ; Clear the OWID saved in EEPROM / one ID1
brne pro_rc_6
+ ldi temp,7
+pro_rc_5a:
ldi XL,low(E2END)
ldi XH,high(E2END)
- subi XL,7
+ sub XL,temp
out EEARH,XH
out EEARL,XL
ldi temp, (0<<EEPM1)|(0<<EEPM0)
pro_rc_6:
- ret
+ cpi rwbyte,0x8C ; Clear the OWID saved in EEPROM / one ID2
+ brne pro_rc_7
+ ldi temp,7+8
+ rjmp pro_rc_5a
+pro_rc_7:
+ ret
pro_write_scratchpad:
st X+,rwbyte