I connected a DS1820 temperature senzor to a ms430 ucontroler . The senzor is externally supplied (not parasite). I connected the grounds from senzor, msp430 and from my power supply together . I also have a 4.7K pullup resistor on my data line (discussed here https://www.electro-tech-online.com/threads/need-help-with-a-following-robot.15584/) .My wires are about 25 cm long . The initialisation procedure which the senzor requests is :
- During the initialization sequence the bus master (msp430)transmits (TX) the reset pulse by pulling the 1-wire bus
low for a minimum of 480 µs. The bus master(msp430) then releases the bus and goes into receive mode (RX).
When the bus is released, the 5k pullup resistor pulls the 1-wire bus high. When the DS18S20 detects
this rising edge, it waits 15–60 µs and then transmits a presence pulse by pulling the 1-wire bus low for
60–240 µs.
I put my asm source for the implementation of this initialization procedure below. For some reason the senzor doesn't respond with the presence pulse . Why doesn't the senzor respond ?
mov #01h,P0DIR ; set P0.0 as ouput portpin
MOV.B #0h,&P0OUT ; pull the bus low 480 us
mov #08h,r5;contor
label8:
mov #10h,r7 ;contor
label:
dec r7
jnz label
; aici se termina 60 us
dec r5
jnz label8
;480 us(actually 510 us by my calcutions) delay ends
BIC.B #01h,P0DIR ; Set P0.0 as input and release the bus
;----------------------------------------------------------
mov #10h,r11 ; contor
label1:
dec r11
jnz label1
; 60 us delay ends (time for 4,7 K resistor to pull the bus high)
;----------------------------------------------------------
;----------------------------------------------------------
; 60 us loop begins
mov #10h,r10
bucla1:
dec r10
jnz bucla1
; 60 us loop ends
MOV.B &P0IN,r5; read from P0.0 cause the presence pulse has to arrive ; it doesn't !!! THIS Is MY PROBLEM !!!
- During the initialization sequence the bus master (msp430)transmits (TX) the reset pulse by pulling the 1-wire bus
low for a minimum of 480 µs. The bus master(msp430) then releases the bus and goes into receive mode (RX).
When the bus is released, the 5k pullup resistor pulls the 1-wire bus high. When the DS18S20 detects
this rising edge, it waits 15–60 µs and then transmits a presence pulse by pulling the 1-wire bus low for
60–240 µs.
I put my asm source for the implementation of this initialization procedure below. For some reason the senzor doesn't respond with the presence pulse . Why doesn't the senzor respond ?
mov #01h,P0DIR ; set P0.0 as ouput portpin
MOV.B #0h,&P0OUT ; pull the bus low 480 us
mov #08h,r5;contor
label8:
mov #10h,r7 ;contor
label:
dec r7
jnz label
; aici se termina 60 us
dec r5
jnz label8
;480 us(actually 510 us by my calcutions) delay ends
BIC.B #01h,P0DIR ; Set P0.0 as input and release the bus
;----------------------------------------------------------
mov #10h,r11 ; contor
label1:
dec r11
jnz label1
; 60 us delay ends (time for 4,7 K resistor to pull the bus high)
;----------------------------------------------------------
;----------------------------------------------------------
; 60 us loop begins
mov #10h,r10
bucla1:
dec r10
jnz bucla1
; 60 us loop ends
MOV.B &P0IN,r5; read from P0.0 cause the presence pulse has to arrive ; it doesn't !!! THIS Is MY PROBLEM !!!