Page 3 of 4

Re: Measurement of temperature and relative humidity using D

Posted: Wed Apr 06, 2016 6:52 pm
by paridhi
Hi,
I tried DHT11v1.01.fcf with ECIO-40P. But it gives CheckSum Error, Trying again... Can you help me please.

Re: Measurement of temperature and relative humidity using D

Posted: Wed Apr 06, 2016 10:36 pm
by medelec35
Hi paridhi,
The errors are caused because ECIO-40 has a 16bit timer0 but the V5 flowchart was designed for 16F877A which has a 8bit timer.
Therefore all the C code blocks referring to tmr0 will produce an error.
You could use timer2 instead of timer0 and change all

Code: Select all

 tmr0 
to

Code: Select all

tmr2
.
Also when changing timer interrupt component to timer 2, it would be best if you can change to the following values:

Code: Select all

Prescaler = 1:4
Postscaler = 1:3
Rollover = 205.
Then if all goes correctly should compile:

Code: Select all

File name:     C:\Users\Martin\Downloads\DHT11v1.01.c
Title:         
Description:   
Generated by:  Flowcode v5.5.2.1
Date:          Wednesday, April 06, 2016 22:22:06
Licence:       Professional
Registered to: Martin ********
Licence key:   6HEP0Q
http://www.matrixmultimedia.com
Launching the compiler...
C:\Program Files (x86)\Flowcode\v5\Tools\boostc\boostc_pic18_flowcode.exe -v -t PIC18F4455 "DHT11v1.01.c"
BoostC Optimizing C Compiler Version 7.04 (for PIC18 architecture)
http://www.sourceboost.com
Copyright(C) 2004-2011 Pavel Baranov
Copyright(C) 2004-2011 David Hobday

Licensed to FlowCode User under Single user Pro License for 1 node(s)
Limitations: PIC18 max code size:Unlimited, max RAM banks:Unlimited


DHT11v1.01.c
Starting preprocessor: C:\PROGRA~2\Flowcode\v5\Tools\boostc\pp.exe DHT11v1.01.c -i C:\PROGRA~2\Flowcode\v5\Tools\boostc\include -d _PIC18F4455 -la -c2 -o DHT11v1.01.pp -v -d _BOOSTC -d _PIC18 -d _CHAR_INDEX 


.............................

DHT11v1.01.c success

success
Return code = 0
Launching the linker/assembler...
C:\Program Files (x86)\Flowcode\v5\Tools\boostc\boostlink_pic.exe -rb 0x800 -ld "C:\Program Files (x86)\Flowcode\v5\Tools\BoostC\lib" libc.pic18.lib rand.pic18.lib float.pic18.lib "DHT11v1.01.obj" -t PIC18F4455 -d "C:\Users\Martin\Downloads" -p "DHT11v1.01"
BoostLink Optimizing Linker Version 7.03
http://www.sourceboost.com
Copyright(C) 2004-2011 Pavel Baranov
Copyright(C) 2004-2011 David Hobday


Warning unreferenced functions removed:
	 FC_CAL_Port_In__x	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_IO.c
	 FC_CAL_Port_In_DDR__x	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_IO.c
	 FC_CAL_Port_Out__x	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_IO.c
	 FC_CAL_Port_Out_DDR__x	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_IO.c
	 Wdt_Delay_S	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_Delay.c
	 FCI_DELAYINT_US	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_Delay.c
	 FCI_DELAYINT_MS	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_Delay.c
	 FCI_DELAYINTWDT_MS	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_Delay.c
	 FCI_DELAYINT_S	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_Delay.c
	 FCI_DELAYINTWDT_S	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_Delay.c
	 FCI_GETCHAR	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
	 FCI_GETLENGTH	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
	 FCI_MIDSTRING	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
	 FCI_LEFTSTRING	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
	 FCI_RIGHTSTRING	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
	 FCI_TOSTRING	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
	 FCI_TOLOWER	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
	 FCI_TOUPPER	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
	 FCI_COMPARE	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
	 FCI_FLOAT_TO_STRING	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
	 FCI_NUMBER_TO_HEX	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
	 FCI_STRING_TO_INT	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
	 FCI_STRING_TO_FLOAT	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
	 FCI_STRREV	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
	 FCI_STRMOV	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
	 FCI_SHEAD	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
	 FCI_SCOPY	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
	 isinf	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_Float.c
	 flt_round	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_Float.c
	 flt_floor	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_Float.c
	 flt_ceil	 in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_Float.c
	 FCD_LCDDisplay0_Command	 in: C:\Users\Martin\Downloads\DHT11v1.01.c
	 FCD_LCDDisplay0_ScrollDisplay	 in: C:\Users\Martin\Downloads\DHT11v1.01.c
	 FCD_LCDDisplay0_ClearLine	 in: C:\Users\Martin\Downloads\DHT11v1.01.c
	 FCD_LCDDisplay0_RAM_Write	 in: C:\Users\Martin\Downloads\DHT11v1.01.c

Building CASM file
Memory Usage Report
===================
RAM available:2048 bytes, used:73 bytes (3.6%), free:1975 bytes (96.4%), 
Heap size:1975 bytes, Heap max single alloc:127 bytes
ROM available:22528 bytes, used:2872 bytes (12.8%), free:19656 bytes (87.2%)



success
Return code = 0

FINISHED
Martin

Re: Measurement of temperature and relative humidity using D

Posted: Fri Apr 08, 2016 3:32 pm
by medelec35
To make life that bit easier, I have converted DHT11v1.01.fcf to work with a lot more devices.
So should work with ECIO40P or a 16F1937 with internal osc or external crystal from 16MHz.

Only way I could think of doing that is to remove timer interrupt altogether and just use delays.

Martin

Re: Measurement of temperature and relative humidity using D

Posted: Fri Apr 15, 2016 7:09 am
by paridhi
I tried DHT11v1.01 No timer interrupt.fcf, its not working. When I displayed the delay count, it showed 4 .
I also did the above mentioned setting of presacalar ratios and timers in DHT11v1.01.fcf program. It always give checksum error.
My Dht11 is working correctly, I checked it with Arduino microcontroller.

Re: Measurement of temperature and relative humidity using D

Posted: Fri Apr 15, 2016 8:09 am
by medelec35
I tried my DHT11 with ECIO40p and I got the humidity and temp displayed OK with the non timer interrupt version.
Are you referring to ECIO-40p Eblock?

Re: Measurement of temperature and relative humidity using D

Posted: Fri Apr 15, 2016 12:55 pm
by paridhi
I am using the USB programmable microcontroller ECIO 40P. I have connected Dht11 directly through the bread board with the same connections as shown on the the first page. Can you send me the edited program of chip PIC 18F4455? Maybe I made an error somewhere...

Re: Measurement of temperature and relative humidity using D

Posted: Fri Apr 15, 2016 1:31 pm
by medelec35
Hi paridhi,
To make sure, I have downloaded

Code: Select all

DHT11v1.01 No timer interrupt.fcf
from a couple of posts above.
Changed target to ECIO-40
Re- programmed ECIO-40p and got the following:
ECIO-40P.jpg
ECIO-40P.jpg (96.79 KiB) Viewed 12776 times
If you are using with a separate 18F4455 and not ECIO-40p then the clock speed must be 16MHz or above.

If you have modified flowchart, then if you post it I can take a look at it for you.

Martin

Re: Measurement of temperature and relative humidity using D

Posted: Fri Apr 15, 2016 2:00 pm
by paridhi
DHT11v1.01 No timer interrupt.fcf shows Delay_count 1. Also the clock speed is 48MHz.

Re: Measurement of temperature and relative humidity using D

Posted: Fri Apr 15, 2016 2:11 pm
by paridhi
Sorry, I don't know how to make this picture small.
The clock frequency is by default 48MHz. As shown in datsheet.

Re: Measurement of temperature and relative humidity using D

Posted: Fri Apr 15, 2016 2:15 pm
by medelec35
paridhi wrote:shows Delay_count 1. Also the clock speed is 48MHz.
Confused with that.
The flowchart shows :

Code: Select all

Delay = 25 
Also not sure if its the camera angle or not, but it looks like connection to DHT11 is going to port A1 and not port A0?

Re: Measurement of temperature and relative humidity using D

Posted: Fri Apr 15, 2016 2:17 pm
by paridhi
It is A0 port only.

Re: Measurement of temperature and relative humidity using D

Posted: Fri Apr 15, 2016 2:21 pm
by medelec35
Must be camera angle then.
But A0 should be 4th socket along and looks like nothing in 4th, but red wire in 5th (A1)
Unless GND in in socket 2 in stead of socket 1 of bread board?
Can't tell from pic.
Just going over everything.
What's the colour bands on resistor?

Re: Measurement of temperature and relative humidity using D

Posted: Fri Apr 15, 2016 2:35 pm
by paridhi
yellow, purplel, red, golden 4.7k

Re: Measurement of temperature and relative humidity using D

Posted: Fri Apr 15, 2016 2:38 pm
by paridhi
and its A0 only. The pin is working fine. I just tested it. And it is getting signal from DHT11 (tested with led). DHT11 is working fine (also tested).
However, it doesnt Checksum error now. When i remove the wire and connect it again multiple times, it shows Checksum error then.

Ground is blue wire.

Re: Measurement of temperature and relative humidity using D

Posted: Fri Apr 15, 2016 2:46 pm
by paridhi
It worked, momentraily. I was testing the input provided by DHT11. Just as I removed it from the board, it showed the temp and humidity. Its not working properly due to Breadboard I think. :o

Re: Measurement of temperature and relative humidity using D

Posted: Fri Apr 15, 2016 2:46 pm
by paridhi
Thank you, alot.
Sorry, I wasted your time.

Re: Measurement of temperature and relative humidity using D

Posted: Fri Apr 15, 2016 3:05 pm
by medelec35
paridhi wrote:Sorry, I wasted your time.
Please don't think that.
You have not wasted my time at all.
I'm here to help.

Re: Measurement of temperature and relative humidity using D

Posted: Sun Apr 24, 2016 12:19 pm
by stregato
Good day to all
Someone could help me to adapt the code for Arduino UNO or NANO or MEGA Thanks

Re: Measurement of temperature and relative humidity using D

Posted: Sat Apr 30, 2016 12:26 pm
by paridhi
I thought my mistake was wires. But it was the the Delay used in Delay us. It had no value. The warning text was showing during compiling, but since it scrolled upwards, I didn't see it.

Re: Measurement of temperature and relative humidity using D

Posted: Sat Apr 30, 2016 3:32 pm
by medelec35
So long as all is working.

Martin

Re: Measurement of temperature and relative humidity using DHT11

Posted: Tue Nov 20, 2018 2:41 pm
by Oderlando
Hi. I'm trying to show the humidity values, read by the DHT11 sensor, on a 7-segment 4-digit display, but I'm not getting it. I was able to display ADC values on the display, but I do not know how to do this for the DHT11. I'm posting the file to the test I did for the ADC. Could anyone modify it for me so that it shows the humidity reading of DHT11?

Re: Measurement of temperature and relative humidity using DHT11

Posted: Tue Nov 20, 2018 4:02 pm
by QMESAR
Hi.
It would be better if you post your flowchart that you tried ,people will more easily help with correcting your mistakes as
making the Flowchart for you

Re: Measurement of temperature and relative humidity using DHT11

Posted: Tue Nov 20, 2018 8:30 pm
by Oderlando
I'm posting the flowchart I've assembled so far. I could not progress in the formulas to be able to show the reading of the DHT11 in the display 7 segments of 4 digits. I am a beginner in FlowCode and I am doing a lot of research to try to achieve this.

Re: Measurement of temperature and relative humidity using DHT11

Posted: Tue Nov 20, 2018 11:20 pm
by Oderlando
I've made a breakthrough. I can already display the numbers in the diplay. Now all I need to do is find out why this odd behavior of the numbers go up to 100 and return to zero as the humidity value increases to the maximum.

Re: Measurement of temperature and relative humidity using DHT11

Posted: Wed Nov 21, 2018 8:57 am
by mnf
Hi,

You are currently trying to display the humidity - but - the sensor can't be read particularly quickly so I would add a delay to your loop and also just wait until you have a read value before displaying anything.

And the variables need to be changed to floats - you are currently reading a float value into a byte which won't have the result you are after - you would need to use a float to read the humidity and temperature to.

Try something like:
Controle_Umidade1.fcfx
(10.5 KiB) Downloaded 66 times
- here I got the humidity as a string - but you could also use GetTempWhole etc to avoid the floating point math.

Martin