Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[Help] 8051 interfacing sensirion SHT7X digital sensor

Status
Not open for further replies.
Hi, i have a weird problem here.

Usually my compiler give me error message if there are error.

But now it don't give me error message although it say i have 2 error?

And now every done code i try to compile, it give me 1 error message notice,but dont show the error message.

Why could this happen.

I tried reinstall the compiler and test a simple error program, and there was error message given again.

But when i load my full code, it don't show error message.

The weird thing is that,when i again write a simple error program,it say i have 1error,but don't show me the error message again.

i go thru my program,and hardly find any noticeable error...

Can u help me to complie my program ,and tell me where is the 2 error?Or any compiler can u recommend me

This is a full code for measuring both the humidity and temperature every 2seconds and display on LCD.Without simplification and packed yet.

Thank you.
 

Hi,
I will try, in the mean time, are you using a limited version of the Assembler and your code is exeeding the limit ? In that case some code packing might help.I think you can get 64k version of ASM51 from Atmel site. You may need to make only minor changes in your code to make it compatible, just try.

Regards,
Laktronics.

Added after 2 hours 10 minutes:

Hi,
Yes two symbol mistakes are there.
1. On line No.98 DATAAA is used instead of DATAA, it is in the start routine of humidity.
2. On line 533, Ro is used instead of R0. It is towards the end, before the lookup table.
Regards,
Laktronics

Added after 1 hours 7 minutes:

Hi,
Did you find out the problem ? You can also do the following:
1. Shift all codes EXCEPT 'END' statement, after the lookup table, to above the table so that your code size does not unnecessarily blow up.
2. You can even shift the look up table to 1000h or even less so that the overall code size will be reduced, and always keep the table as the last set of code, terminated by END statement. IF you do this, REMEMBER to make suitable changes to the table access statement ' mov dpr,#tablestartaddress'.

Regards,
Laktronics

Added after 4 hours 22 minutes:

Hi,
1. I found one mistake in your Humidity_convert routine. Its RET is placed after the lookup table, it should be shifted to above the table.

2. Coming to think of it, it is not necessary to absolutely fix the start address of the table. You can remove the ORG from there and assign a label to the DB directive. When you load DPTR with the table base address, simply mov the label immediately as in MOV DPTR,#label_table. This will also allow you to place the table anywhere in between program modules, though it is always preferable to keep it at the end.

Could you find a way out of your Assembler problem, if you look at the list file you mean it does not show the details of the errors?

Regards,
Laktronics.
 

Yah,it don't show the detail of error.I don't know why.

Thanks for the correction.

Added after 51 minutes:

Hi, i can't get the reading on LCD for humidity,temperature is working fine.

No display of 'H' and 'M' totally.Is it i need to initiate the LCD again?

Or the position parameter i enter is wrong?
84H= 1st line 4th position
94H= 2nd line 4th position?
 

Hi,
1. I hope you have corrected for the RET mistake, else humidity will not work as well as subsequent readings of temperature also may not work. Also I thought you must have put the address for the cursor after consulting the LCD manual. One of the manuals for 2x16 LCD which I have says the first character address for line 1 is 00h and that of line 2 is 40h. Please check the detailed user manual of your display.

2. If the temperature is getting updated, then the problem mostly is somewhere in the humidity processing part of the software. However, if the temperature shows only once then you may have to think of other possibilities also.

3.You have not told if you are using a limitted version of assembler, in which case, you can not probably depend on the assembled code as well.

Regards,
Laktronics.

Added after 9 minutes:

Hi,
Yes, that appears to be your problem, you seem to be writing into a void space in LCD. Use C4h instead of 94h.

Regards,
Laktronics.
 

Hi,

My humidity and temperature reading is showing correctly.

I figure out the 2nd line of my LCD spoiled, just one line is functionable.

My assembler is provided by our lecturer,how to check is it limited edition.
 

Hi,
Nice to hear that you are able to get both readings right. Congrats!

But, why continued problem with LCD? Is your 5V supply alright? Use adequate filtering and if required use a 5.6V zener across it and provide a fuse for 5V to take care just incase the zener shorts. Do not allow the LCD bare pins to touch your circuit parts.Are you using a connector to plug in LCD? If the LCD edge connector pins have holes on them, you can mount a single row header onto to it and use a header receptacle on your PCB so that you can avoid long wires between LCD and the board.

Regarding the Assembler, I can not say how it will react if you try to assemble files larger than allowed by it and how to check if it is a limitted edition or not, unless any message comes while running it. You can download 64K version of ASM51 from Metalink Corp. for free. But you have to make some small changes in your program with respect to bit definitions and some Assembler directives, but that is easy, you can correct those statements from the error list you get when you assemble your present program once using it.

Also, if use a label for the lookup table instead of the present ORG, your code size will come down considerably.

Regards,
Laktronics
 

Hi,

I have one weird conditions

My reading for temperature sometimes will jump to "12.83 "

And the humidity sometimes will jump to "41.12"

Why could this happen?

I let the reading to be taken every 2 sec

Added after 1 hours 50 minutes:

I added some delay before measure humidity.

Now my temperature reading wont jump to 12.83

But still humidity will jump to 41.12 quite often.
 

Hi,
It appears to be a noise pick up.
1. Are you testing in a noisy environment?
2. How long is the wire (if any) connecting the sensor to the microcontroller pins?
3. You have to a connect a 0.1uf capacitor across Vcc and ground pins of the sensor.
4.Connect an external 10k pullup resistor on the SDA and SCL lines to reduce the noise effect on these lines.
5. Does the wrong reading come only for one sample or for a few samples continuously? How often does such errors come, that is approximately after how many correct samples a wrong sample comes?
6. Is it a recent change that you are seeing? Have you made any changes in the PCB?
7. Check for the ripple levels in the Vcc line.
Check the above points and try to findout the source of the problem.

Regards,
Laktronics.
 

Hi everyone,

I am new to this forum and found it interesting this topic because i have a same project with a P89C51RD + microcontroller and a sht71 sensor but i have a problem with interfacing.

I'm curious to know if your project finaly worked correctly.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top