реклама на сайте
подробности

 
 
> Dewpointer
Andrejka
сообщение Jan 2 2009, 19:28
Сообщение #1


Участник
*

Группа: Участник
Сообщений: 18
Регистрация: 7-12-08
Пользователь №: 42 268



Hi, I found a schematic of simple temperature, huminidity and dewpoint measuring cicruit. Originally device uses: Sht11 sensor, AT90S8535 MCU, and HD44780 like 20x4 LCD. In my project I replace Sht11 with Sht15 (from Sparkfun), At90s8535 is replaced with newer Atmega8535 (Atmel datasheets say - this is a at90s8535 direct repalcement). But this device working incorrectly, so I have only "Sht11 Monitor" label on LCD, without sensor readings. If possible please help me with source code.

Source project:







URL:
Source project - http://www.embedtronics.com/sht11/sht11.html
Source code - http://www.embedtronics.com/sht11/shtdemo1.c
Schematic - http://www.embedtronics.com/sht11/SHT11Sch.pdf


My device show only this label:



I tried to simulate device in Proteus simulator but this program show the same screen, without sensor readings, only label.


Thank You!
Go to the top of the page
 
+Quote Post
 
Start new topic
Ответов
Andrejka
сообщение Jan 5 2009, 14:38
Сообщение #2


Участник
*

Группа: Участник
Сообщений: 18
Регистрация: 7-12-08
Пользователь №: 42 268



My Atmega8535 fuses are: CKSEL3..0 - 1111, and I using exeternal 4 MHz crystal, the same as in original design from http://www.embedtronics.com/sht11/sht11.html

Sht11 and Sht15 sensors manufacturer provide a sample C code for AT89S53 with data output into UART (for eg. PC hyperterminal).

http://www.sensirion.com/en/pdf/product_in...ensor_SHTxx.pdf

Сообщение отредактировал Andrejka - Jan 5 2009, 14:44
Go to the top of the page
 
+Quote Post
korobov_michael
сообщение Jan 5 2009, 20:07
Сообщение #3


Частый гость
**

Группа: Свой
Сообщений: 118
Регистрация: 11-03-07
Из: Украина, Харьков
Пользователь №: 26 059



Цитата(Andrejka @ Jan 5 2009, 16:38) *
Sample_Code_humidity_sensor_SHTxx.pdf

I have modeled the design in Proteus. Due to differences in architectures 8051 and AVR there are time restrictions in C instructions. Each assembler instruction in 8051 requires 12 clock cycles and in AVR it takes approx two cycles. So the same code will take different cycles to complete. At first time I obtained errors during measurement. When I inserted delays in code
Код
for (i=0;i<65535;i++)
   {
        __delay_cycles(14); //approx. 1us at 14.7456MHz quartz
        if(PINB&_BV(0) == 0)
            break; //wait until sensor has finished the measurement
   }


in function s_measure(), I obtained all measurements are adequate.

P.S. I'm using IAR, so you have to use your delay function. If you want, I'll give you source codes for IAR that I have made to test.
Regards!

Сообщение отредактировал korobov_michael - Jan 5 2009, 20:08
Go to the top of the page
 
+Quote Post
Andrejka
сообщение Jan 6 2009, 05:52
Сообщение #4


Участник
*

Группа: Участник
Сообщений: 18
Регистрация: 7-12-08
Пользователь №: 42 268



Цитата(korobov_michael @ Jan 6 2009, 00:07) *
I have modeled the design in Proteus. Due to differences in architectures 8051 and AVR there are time restrictions in C instructions. Each assembler instruction in 8051 requires 12 clock cycles and in AVR it takes approx two cycles. So the same code will take different cycles to complete. At first time I obtained errors during measurement. When I inserted delays in code
Код
for (i=0;i<65535;i++)
   {
        __delay_cycles(14); //approx. 1us at 14.7456MHz quartz
        if(PINB&_BV(0) == 0)
            break; //wait until sensor has finished the measurement
   }


in function s_measure(), I obtained all measurements are adequate.

P.S. I'm using IAR, so you have to use your delay function. If you want, I'll give you source codes for IAR that I have made to test.
Regards!




Yes, if possible provide IAR code for me.

Thanks!
Go to the top of the page
 
+Quote Post
korobov_michael
сообщение Jan 6 2009, 07:39
Сообщение #5


Частый гость
**

Группа: Свой
Сообщений: 118
Регистрация: 11-03-07
Из: Украина, Харьков
Пользователь №: 26 059



Цитата(Andrejka @ Jan 6 2009, 07:52) *
Yes, if possible provide IAR code for me.

Here it is.
In 'hardware' folder there is proteus simulation.
Please remember, that I just worked to setup correct interface, so I'm not calculate temperature, and my humidity calculations contain non-linear not compensated errors. Anyway, compensation will not be a problem I hope.
Regards

P.S. Please remember, that code provided is not of high quality - I've just adapted the code proposed by Sensirion in the way that will be easy of use to you. But if you will only measure humidity, temperature and will have unlimited power source, it will work
Regards

Сообщение отредактировал korobov_michael - Jan 6 2009, 07:46
Прикрепленные файлы
Прикрепленный файл  DewPoint.rar ( 76.22 килобайт ) Кол-во скачиваний: 86
 
Go to the top of the page
 
+Quote Post

Сообщений в этой теме
- Andrejka   Dewpointer   Jan 2 2009, 19:28
- - korobov_michael   I found the following: 1. At initialization, you s...   Jan 3 2009, 06:45
- - ReAl   Цитата(Andrejka @ Jan 2 2009, 21:28) I tr...   Jan 3 2009, 07:30
- - Andrejka   Thanks for reply! Maybe I just simple attach a...   Jan 4 2009, 13:38
|- - _Pasha   Цитата(Andrejka @ Jan 4 2009, 17:38) Mayb...   Jan 4 2009, 14:11
|- - korobov_michael   Цитата(Andrejka @ Jan 4 2009, 15:38) Mayb...   Jan 5 2009, 06:44
|- - _Pasha   Цитата(Andrejka @ Jan 5 2009, 18:38) Sht1...   Jan 5 2009, 18:21
||- - korobov_michael   Цитата(_Pasha @ Jan 5 2009, 20:21) Please...   Jan 5 2009, 18:42
|- - _Pasha   Цитата(korobov_michael @ Jan 6 2009, 00:0...   Jan 5 2009, 20:22
||- - korobov_michael   Цитата(_Pasha @ Jan 5 2009, 22:22) You si...   Jan 5 2009, 21:32
|- - Andrejka   Цитата(korobov_michael @ Jan 6 2009, 00:0...   Jan 6 2009, 21:43
- - radu   hello i'm beginner and i have the same problem...   Jan 16 2009, 10:39
- - radu   hello again i solve the problem regarding correct ...   Jan 16 2009, 19:16
|- - korobov_michael   Цитата(radu @ Jan 16 2009, 21:16) hello a...   Jan 17 2009, 06:57
- - B0SC0   I, too, am working on this project and have a prob...   Jan 22 2009, 20:17
- - korobov_michael   Well, first of all give me please a couple of your...   Jan 23 2009, 13:06
- - B0SC0   Цитата(korobov_michael @ Jan 23 2009, 08...   Jan 23 2009, 14:05
- - Andrejka   Цитата(B0SC0 @ Jan 23 2009, 17:05) The co...   Jan 24 2009, 19:40
- - B0SC0   Цитата(Andrejka @ Jan 24 2009, 14:40) Jus...   Jan 25 2009, 04:25
- - Andrejka   Цитата(B0SC0 @ Jan 25 2009, 08:25) Yes, I...   Jan 25 2009, 17:50


Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 22nd July 2025 - 02:23
Рейтинг@Mail.ru


Страница сгенерированна за 0.01426 секунд с 7
ELECTRONIX ©2004-2016