Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 28, 2024, 12:12:01 00:12


Login with username, password and session length


Pages: [1]
Print
Author Topic: Question about DS1820 model for Proteus  (Read 8837 times)
0 Members and 1 Guest are viewing this topic.
linoko
Newbie
*
Offline Offline

Posts: 25

Thank You
-Given: 3
-Receive: 7


« on: November 17, 2005, 02:08:19 14:08 »

Hi Friends,
I'll try the DS1820 that i posted 2 days ago, in one of my source codes, but i have a problem, i thing that this model i'snt work correct. Do you try it and what is your  opinion about it.
Please send your answers
Logged

Nothing is impossible
vass
Guest
« Reply #1 on: November 17, 2005, 03:56:39 15:56 »

Hi, linoko
The model you have is an old and incomplete version. It supports only the commands
Match ROM, Skip ROM, Convert T and Read Scratchpad.
A new improved version will be released soon in which will be added the other
commands (as Read ROM and Search ROM).
If your problem is not in the lack of these ROM commands please describe it.
Logged
jibun24
Newbie
*
Offline Offline

Posts: 13

Thank You
-Given: 0
-Receive: 0


« Reply #2 on: November 17, 2005, 06:18:39 18:18 »

Hi,
I used yesterday the model for DS18B20 and it working fine, but I don't use the commands for read ans search rom.
I use the following commands: Skip ROM, Convert T and Read Scratchpad.
Logged
linoko
Newbie
*
Offline Offline

Posts: 25

Thank You
-Given: 3
-Receive: 7


« Reply #3 on: November 18, 2005, 09:14:58 09:14 »

Hi friends,
 i need help with this project
the source that i use is:

temperature VAR WORD' Temperature storage
count_remain VAR BYTE' Count remaining
count_per_c VAR BYTE' Count per degree C

DQ VAR PORTC.0' One-wire data pin


' Define LCD registers and bits
DEFINE LCD_DREG     PORTD
DEFINE LCD_DBIT     4
DEFINE LCD_RSREG    PORTE
DEFINE LCD_RSBIT    0
DEFINE LCD_EREG     PORTE
DEFINE LCD_EBIT     1


ADCON1 = 7' Set PORTA and PORTE to digital
Low PORTE.2' LCD R/W line low (W)


mainloop: Owout DQ, 1, [$CC, $44]       ' Start temperature conversion

waitloop: Owin DQ, 4, [count_remain]' Check for still busy converting
IF count_remain = 0 Then waitloop

OWOut DQ, 1, [$CC, $BE]' Read the temperature
OWIn DQ, 0, [temperature.LOWBYTE, temperature.HIGHBYTE, skip 4 , count_remain, count_per_c]

' Calculate temperature in degrees C to 2 decimal places (not valid for negative temperature)
temperature = (((temperature >> 1) * 100) - 25) + (((count_per_c-count_remain) * 100) / count_per_c)
LCDOut $fe, 1, DEC (temperature / 100), ".", DEC2 temperature, " C"

' Calculate temperature in degrees F to 2 decimal places (not valid for negative temperature)
'temperature = (temperature */ 461) + 3200
'LCDOut $fe, $c0, DEC (temperature / 100), ".", DEC2 temperature, " F"

        Pause 2000                      ' Display about once a second

GoTo mainloop' Do it forever


but i want to connect 4-DS1820 and read it and display it on 4x20 LCD. When i realize this with Proteus , when i simulate source on LCD is dislayed 7.89 celsius but i was set DS1820 1 celsius

Please help
Logged

Nothing is impossible
vsmvdd
Junior Member
**
Offline Offline

Posts: 92

Thank You
-Given: 1
-Receive: 25


« Reply #4 on: November 18, 2005, 12:52:49 12:52 »

OWOut DQ, 1, [$CC, $BE]' Read the temperature
OWIn DQ, 0, [temperature.LOWBYTE, temperature.HIGHBYTE, skip 4 , count_remain, count_per_c]
 
' Calculate temperature in degrees C to 2 decimal places (not valid for negative temperature)
temperature = (((temperature >> 1) * 100) - 25) + (((count_per_c-count_remain) * 100) / count_per_c)
LCDOut $fe, 1, DEC (temperature / 100), ".", DEC2 temperature, " C"
 
' Calculate temperature in degrees F to 2 decimal places (not valid for negative temperature)
'temperature = (temperature */ 461) + 3200
'LCDOut $fe, $c0, DEC (temperature / 100), ".", DEC2 temperature, " F"
 
Pause 2000 ' Display about once a second
 
 
looking at the code it is fine
 
therefore it must be something in your equassion that works out the tempreture display
 
i notice you have an issue within the above code i pasted
youll see that the tempreture is worked from the last event of tempreture
instead of using two variables array {1st part of array is deg c second deg f}
so the original value for deg f will be dirived from your calculation of degc and not what was read from the chip maybe this is where its going wrong
 
1 deg c = 33.8 F
 
therefore 7.89 is a strange number to get back
 
sounds like its in your equassion somehwhere
 
http://www.rentron.com/PICX4.htm
 
here is a project i found on rentons site
its in basic  so i think will be good to study it Smiley
Logged
linoko
Newbie
*
Offline Offline

Posts: 25

Thank You
-Given: 3
-Receive: 7


« Reply #5 on: November 18, 2005, 02:13:00 14:13 »

Hi, I post as attachment my work
and the project, please help me..
My project is to make with PIC16F84 and 4 DS1820 and 4x20 LCD the thermometer.

But the problem is that it's work incorrect
Logged

Nothing is impossible
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC