Fellas,
I am having a problem with my LCD display that I can't seem to figure out what the deal is. I have a 16 x 2 LCD that has a Hitachi 44780 driver. I am having problems with the value it is reading being displayed in a useable number.
Sitting at "idle" the LCD outputs 00008, which is fine. But then when the values increase it gets up to 00010 and then roles back around to 00001 and can do that for several cycles up and down. What is it doing? It should be outputting a velocity in relation to the pressure.
My basic LCDOUT command is as follows
Code:
LCDOUT $FE, 1,"Begin Program"
Pause 2000
'main loop
main:
ADCIN 4, ad_word 'read value from voltage input on AN4 (pin 3) and then store as ad_word
Pauseus 200 'check sampling time for that of the sensor and the pic to see if this value is correct
P = maxp * ad_word / 1023 'equation to calculate pressure using the variables and constants defined earlier
'Also contains 10 bit results
'Hopefully will output whole value without truncation, if it does find value to multiple by
Pauseus 200
X = 20 * P / 12
Pauseus 200
V = SQR X 'calculating velocity with the sqaure root of 2 times pressure (p) divide by density (1.2)
Pauseus 200
LCDOUT $FE, 1
LCDOUT $FE, $80 + 4, dec5 V 'Output Velocity to LCD, should be in m/s
Pauseus 200
Goto main
End
Any thoughts?
You are all great and I am so thankful for all the help you guys are giving me!
-Marcus
Bookmarks