electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

Problem with DS1620 - temperature on the LCD


Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> Problem with DS1620 - temperature on the LCD
Author Message
user0123



Joined: 30 May 2009
Posts: 6


Post15 Sep 2009 17:55   

Problem with DS1620


My 68HC11 project is complete, but when show the temperature on the LCD it always show 28.5 oC, or in BCD – 00111001. I don’t know why. I read the code couple of times to make sure that I didn’t make something wrong. Can somebody help me.

This code I took from here: http://www.emicros.com/ds1620.htm and modify it little because it was showing 0 oC

This is fragments of the code:


RSTTEMP equ %00100000
I_O equ %00001000
SCLK equ %00010000




ReadTemperature:
ldx #REGBLK
bset DDRD,x %00111000
bclr PortD,x SCLK
bset PortD,x RSTTEMP
ldaa #$AA

ldab #8
ZS:
bclr PortD,x I_O
lsra
bcc NS
bset PortD,x I_O
NS:
bset PortD,x SCLK
nop
nop
nop
bclr PortD,x SCLK
decb
bne ZS

clr TempLSB
clr TempMSB
bclr DDRD,x I_O
ldab #8
JJ:
nop
nop
nop
bset PortD,x SCLK
clc
brclr PortD,x I_O HJ
sec
HJ:
ror TempLSB
bclr PortD,x SCLK
decb
bne JJ

bset PortD,x SCLK
brclr PortD,x I_O AD
ldaa #1
staa TempMSB

AD:
bclr PortD,x SCLK
bset DDRD,x I_O
bclr PortD,x RSTTEMP
ldab TempLSB
rts




BCD2STR:
psha
anda #$0F
oraa #$30
staa 1,x
pula
asra
asra
asra
asra
anda #$0F
oraa #$30
staa 0,x
rts




ldaa Str2+1
cmpa LastSecond
beq NoNewTemp
staa LastSecond
jsr ReadTemperature
lsrb
bcc Set00
ldaa #'5'
bra Set05
Set00:
ldaa #'0'
Set05:
staa Str2+12

clra
tba
ldx #Str2+9
jsr BCD2STR
clrb
ldab TempMSB
cmpb #$1
bne NoNewTemp
ldaa #'-'
staa Str2+8
Back to top
Google
AdSense
Google Adsense




Post15 Sep 2009 17:55   

Ads




Back to top
user0123



Joined: 30 May 2009
Posts: 6


Post17 Sep 2009 16:12   

Re: Problem with DS1620


I put this code in the initialization:

ldx #REGBLK
bset DDRD,x %00111000
bclr PortD,x SCLK
bset PortD,x RSTTEMP
ldaa #$EE

ldab #8
ZS1:
bclr PortD,x I_O
lsra
bcc NS1
bset PortD,x I_O
NS:
bset PortD,x SCLK
nop
nop
nop
bclr PortD,x SCLK
decb
bne ZS1


When I done this I begin to get different readings such as 3=, 2> and so on.

So I put this code for the convertion from BCD to degrees, showing on LCD:

clra
ldx #10
idiv
orab #$30
stab str2+10
xgdx
ldx #10
idiv
orab #$30
stab str2+9


When I put it I begin to get from 40oC to 65-70oC, but without any marks or unknown symbols.

I'm surprised of this reading, because the temperature on the corpus of the device is not more than 25-27oC, even colder.

Is there an error in the code for the conversion?
Can somebody tell me better method?
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> Problem with DS1620 - temperature on the LCD
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
DS1620 can it be so hard??? TEMPERATURE READING (1)
ds1620 with db25 (1)
a problem about the temperature dependence of the voltage (2)
a problem about the temperature dependence of the voltage (3)
problem with volatage to temperature conversion(lpc 2129) (3)
Problem in LCD display in PIC 16f876 with 16x2 lcd display (3)
problem with controlling LCD 16x2 with PIC 16f877 (6)
problem with LCD (7)
Problem with LCD (2)
How to simulate the change in VT with temperature? (1)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS