![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) | |||
|
Quote:
Code:
Main movlw 0x?? ; delay value
movwf SomeDelay
Loop call Multiplex ;show the display
call Check_AD ;get the AD value
bcf STATUS,0
rrf ADL,F ;divide the AD value by by 2
call BCD ;call BCD & make into decimals
decfsz SomeDelay, F
goto Loop
call BCD_Split ;move BCD results to segment digits
goto Main
Quote:
Quote:
__________________
--- The days of the digital watch are numbered. --- Last edited by kchriste; 16th January 2008 at 06:07 AM. |
||||
|
|
|
|
|
(permalink) | |
|
Hi kchriste I got your point.For every one second I'll update the display & see.
Thanks for that hint. Quote:
Thats what I know. |
||
|
|
|
|
|
(permalink) |
|
Hi kchriste I followed your three steps all of the methods gave me good results.
I tried one by one, the best method was reading the average value. That is the more accurate method. I added a 16bit register to place the 256 times AD results.& read the higher byte to get the average value. I wrote my own coding again & applied. Sometimes you can see the bubbles.It means if the temperature is 21 celsious when it goes to 22 C it shifting like this 21,22,21,22,21,22,21,22 this happens continuously even if I read the average temperature. I also applied the 2.2K resister with 0.1uF capacitor (low pass filter) So what do you think? Code:
;************ ;Main program ;************ Display call Multiplex Loop call Check_AD incfsz Count256,F ;count 256 AD readings goto $+9 ;No, clrf Count256 ;yes, it has reached 256 times bcf STATUS,C rrf average_H,F ;make the value divide by 2 call BCD ;make the value into decimals call BCD_Split ;convert into segment digits clrf average_H ;clear 16 bit higher byte clrf average_L ;clear 16 bit lower byte goto Display ;show the display with updates movf ADL,W ;take the AD result to W addwf average_L,F ;add the value to lower byte of average register btfss STATUS,C ;has the carry bit set? goto Display ;No, then show the display without updates incf average_H,F ;Yes, then increment the higher byte of average register goto Display ;show the display without updates |
|
|
|
|
|
|
(permalink) | |||
|
Quote:
Quote:
Quote:
__________________
--- The days of the digital watch are numbered. --- Last edited by kchriste; 17th January 2008 at 05:11 AM. |
||||
|
|
|
|
|
(permalink) | |||
|
Quote:
Quote:
Quote:
kchriste I just checked my temperature is correct or not?I measured the LM35 output voltage. Its showing 0.28V = 25 Celsius It should 28 Celsius. Why is this happeneing? Shall I add 3 to the result of the ADC every time? |
||||
|
|
|
|
|
(permalink) |
|
So you are saying that the ambient temperature is 25C and the LM35 is outputting 0.28V? If so, it is possible that the LM35 really is at 28C if it is mounted on a PCB / breadboard that has components generating heat. Also, are you measuring the voltage right at the LM35s pins Vout & Gnd? If not, it is possible that there is a voltage drop in the leads due to current draw from other devices.
__________________
--- The days of the digital watch are numbered. --- |
|
|
|
|
|
|
(permalink) |
|
I looked at the display & it shows 25 C suddenly I measured the voltage Vout to GND in the LM35DZ.It shows 0.28V.
In the real calculation it must show 28 C. My circuit is in a vero board I never use bread boards. |
|
|
|
|
|
|
(permalink) |
|
Hi kchriste I'm trying my best to get a smooth value count in the segments without adjusting or adding any hardware changes.
I'm going to try in different ways.Something like calling AD interrupts etc.... Last night I didn't sleep even. |
|
|
|
|
|
|
(permalink) | |
|
You'll have to do some more tests then. If the LM35 reads 0.28V and your display reads 25 then it is probably due to the fact that your 5V supply, which I assume is used for your ADC reference, is a little high. What is the voltage reading on Vdd of the PIC?
Quote:
It won't work if it reads 3 degrees low at 25C but 6 degrees low at 50C. Then you'd have to adjust the reference/supply voltage.
__________________
--- The days of the digital watch are numbered. --- Last edited by kchriste; 18th January 2008 at 03:38 AM. |
||
|
|
|
|
|
(permalink) |
|
Hi kchriste thanks for being with me through out the thread.
last night I measured all the voltages. Vdd = 5V LM35DZ output voltage = 0.28V at 25 C I replaced another LM35DZ but same.That of course ok.The bubble thing is the main headache. I'm trying various adjustments in my main code to get a smooth stable count up without bubbles. |
|
|
|
|
|
|
(permalink) |
|
Am I the only person who gets this bubble thing error?I have never seen a similar thread like this.How others managed their LM35 temperature sensors? Didn't they get such a effect?
I'm really really upset. |
|
|
|
|
|
|
(permalink) | ||
|
Quote:
http://www.ee.latrobe.edu.au/~gt/ele...s/01-units.pdf Quote:
__________________
--- The days of the digital watch are numbered. --- |
|||
|
|
|
|
|
(permalink) |
|
Ok this weekend I'm going to work out on fully about this in the weekend I'll tell the progress kchriste.
Thanks for the support. |
|
|
|
|
|
|
(permalink) |
|
What sort of displays are you using, what type of regulator, how fast are you running your PIC? Your sensor must be located away from any heat source as even a few LEDs or a fast PIC can heat that LM34 up.
![]() |
|
|
|
|
|
|
(permalink) |
|
Hi blueroomelectronics I’m using CC seven segments. I’m using two segments.
My PIC is running 4MHZ. My regulator is 7805 I measured the VDD & its 5.0V Did you get a bobble error in your last digit? Here is the place I got stucked. |
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Latest |
| Guide to using an MCP2515? | Sam Jelfs | General Electronics Chat | 0 | 4th April 2007 08:13 PM |
| Hotair Soldering Desoldering Guide or Tutorial is Needed | xpacer | General Electronics Chat | 1 | 20th October 2006 05:56 PM |
| Orcad PCB Layout Manual Guide, Help ! | sinkopa | General Electronics Chat | 1 | 31st March 2004 09:20 AM |
| ASM guide | McGuinn | Micro Controllers | 4 | 2nd February 2004 12:37 AM |
| anyone willing to help and guide me?? | philipsi | Micro Controllers | 2 | 23rd December 2003 07:02 AM |