Sorry I have forgotten a Dec. Please read......
LCDOUT $FE, $C0, DEC ByteInteger,",",DEC ByteDecimal
Sorry I have forgotten a Dec. Please read......
LCDOUT $FE, $C0, DEC ByteInteger,",",DEC ByteDecimal
Dear MEN !
I do not use a LCD display . I have make only a comparision .
I use in front of my program this line to write text "
I2Cwrite I2CDAT, I2CCLK, $A0, adr,[" Temperature is _________________ "]
late in program , in free space I wish to write DATA of temperature
adr = 15( where is free space )
I2Cread I2CDAT, I2CCLK, $A0, adr,[ temperature DATA ]
In finish, I wish to can read all - text and temperature DATA as ASCI CODE such as
Temperatura is 25,55(for example) .
from this formula :
i2cread I2CDAT , I2CCLK , $A0,J,[caracter]
program read for every adrress (j) a sign (caracter ) in ASCI Code , and this CODE i'll translate in leds on .But where I write temperature DATA , program read other signs not ASCI CODE for 25,55 ( for example )
Now understand me ?
I 'll try to write only text with quote and temperature DATA except quote
Last edited by Eugeniu; - 17th October 2008 at 09:40.
YOU WROTE:
-------------------------------------------------------------------------
I do not use a LCD display . I have make only a comparision .
I use in front of my program this line to write text "
I2Cwrite I2CDAT, I2CCLK, $A0, adr,[" Temperature is _________________ "]
late in program , in free space I wish to write DATA of temperature
adr = 15( where is free space )
I2Cread I2CDAT, I2CCLK, $A0, adr,[ temperature DATA ]
------------------------------------------------------------------------
I assume you have grounded pin 1 , pin 2 and pin 3 of your 24LC01 chip and that you have pulled up pin 6 and pin 5 with a 4.7K resistors (see page 85 of the manual)
Just use the following code:
'set these variable
WriteDev con %10100000
ReadDev con %10100001
Celsius VAR BYTE [32]
Fix text in the array
Celsius[0]=84
Celsius[1]=101
Celsius[2]=109
Celsius[3]=112
Celsius[4]=101
Celsius[5]=114
Celsius[6]=97
Celsius[7]=116
Celsius[8]=117
Celsius[9]=114
Celsius[10]=32
Celsius[11]=105
Celsius[12]=115
Celsius[13]=32
Celsius[14]=0
Celsius[15]=44
Celsius[16]=0
Now in your program you read temperature from your device and you have the value in the variable TEMPERATURE!
write:
Celsius[14] = TEMPERATURE/100
Celsius[16] = TEMPERATURE - (Celsius[14]*100)
So you will have the integer part of your value in Celsius[14] and the decimal part in Celsius[16]. Celsius[15]=44 is your separator.
Now write to your memory at address 0
adr=0
I2CWRITE I2CDAT, I2CCLK, WriteDev , adr,[ Str Celsius\32]
PAUSE 10
Now if your hardware works properly, you should have stored in your memory the string and the values.
To recall them back:
adr=0
I2CREAD I2CDAT, I2CCLK, ReadDev , adr,[ Str Celsius\32]
Pause 10
At this point you send the array to your display
For A0=0 to 16
single byte (Celsius[A0]) can be sent to your display
Next A0
If you need to store more than on single value you have to increment your Address (adr) by a multiple of 32, and with two values you have filled one page (64 bytes)
Al.
QUOTE=aratti;
-------------------------------------------------------------------------
I do not use a LCD display . I have make only a comparision .
I use in front of my program this line to write text "
I2Cwrite I2CDAT, I2CCLK, $A0, adr,[" Temperature is _________________ "]
late in program , in free space I wish to write DATA of temperature
adr = 15( where is free space )
I2Cread I2CDAT, I2CCLK, $A0, adr,[ temperature DATA ]
------------------------------------------------------------------------
I assume you have grounded pin 1 , pin 2 and pin 3 of your 24LC01 chip and that you have pulled up pin 6 and pin 5 with a 4.7K resistors (see page 85 of the manual)
I use this display NOW , and scroll a simple text , but a long text , what is writing in a 24FC512 menory . It has pins 1,2,3,4 and 7 to ground .
Just use the following code:
'set these variable
What doing this ?
WriteDev con %10100000
ReadDev con %10100001
Celsius VAR BYTE [32]
Fix text in the array
I use a long text ......with caps.letters only ( you can see this in my programe ).
Celsius[0]=84 = T
Celsius[1]=101 = e
Celsius[2]=109 = m
Celsius[3]=112 = p
Celsius[4]=101 = e
Celsius[5]=114 = r
Celsius[6]=97 = a
Celsius[7]=116 = t
Celsius[8]=117 =u
Celsius[9]=114 =r
Celsius[10]=32 = blank
Celsius[11]=105 = i
Celsius[12]=115 = s
Celsius[13]=32 = blank
Celsius[14]=0 this is not 0
Celsius[15]=44 = ,
Celsius[16]=0
Now in your program you read temperature from your device and you have the value in the variable TEMPERATURE!
write:
Celsius[14] = TEMPERATURE/100
Celsius[16] = TEMPERATURE - (Celsius[14]*100)
So you will have the integer part of your value in Celsius[14] and the decimal part in Celsius[16]. Celsius[15]=44 is your separator.
Now write to your memory at address 0
adr=0
I2CWRITE I2CDAT, I2CCLK, WriteDev , adr,[ Str Celsius\32]
PAUSE 10
Now if your hardware works properly, you should have stored in your memory the string and the values.
To recall them back:
Look back in message , I must to use only this formula , only one .
I2Cread I2CDAT , I2CCLK , $A0 , J ,[caracter]
adr=0
I2CREAD I2CDAT, I2CCLK, ReadDev , adr,[ Str Celsius\32]
Pause 10
At this point you send the array to your display
For A0=0 to 16
single byte (Celsius[A0]) can be sent to your display
Next A0
If you need to store more than on single value you have to increment your Address (adr) by a multiple of 32, and with two values you have filled one page (64 bytes)
Thank you !
Either there is still a serious language barrier here or you're not getting what we're trying to say... In either case, I wish I spoke whatever language you speak so we could get this all straightened out a lot faster...
And is it working the way you want it to work?I use this display NOW , and scroll a simple text , but a long text , what is writing in a 24FC512 menory . It has pins 1,2,3,4 and 7 to ground .
Shouldn't have to use 2 different 'codes' for reading and writing to an I2C eeprom. PBP handles the Read/Write bit (bit0 in the 'code') for you. Should only need to use $A0 when addressing a standard 24xxxxx serial eeprom.What doing this ?
Are you storing the entire string, along with the temperature data in the eeprom or just the temperature?I use a long text....with caps.letters only (you can see this in my programe)
That may be so, but to store a temperature, with a whole part and a fractional part, along with any other characters, you are going to need more than one byte of storage and will need more than one I2CWRITE command...Look back in message , I must to use only this formula , only one .
skimask;64321 Either there is still a serious language barrier here or you're not getting what we're trying to say... In either case, I wish I spoke whatever language you speak so we could get this all straightened out a lot faster...
I am from Bucharest , ROMANIA .
And is it working the way you want it to work?
It work OK with a simle text . But I wish to add in the fututre more options such : temperature out , temperature in house , time , date ...
Shouldn't have to use 2 different 'codes' for reading and writing to an I2C eeprom. PBP handles the Read/Write bit (bit0 in the 'code') for you. Should only need to use $A0 when addressing a standard 24xxxxx serial eeprom.
Of course , I use this " $A0 "
Are you storing the entire string, along with the temperature data in the eeprom or just the temperature?
I wish to store only result ( I think that I understand exactly what you say ??)
That may be so, but to store a temperature, with a whole part and a fractional part, along with any other characters, you are going to need more than one byte of storage and will need more than one I2CWRITE command...
Is not important how many I2Cwrite command will be use ,if PIC16F876 support lenght of code . Important is to can used only one command I2Cread to read all - text and data -
Those 2 comments contradict themselves...Is not important how many I2Cwrite command will be use ,if PIC16F876 support lenght of code . Important is to can used only one command I2Cread to read all - text and data
-----Is not important how many I2CWRITE command will be use, if PIC support length of code----
Tells me that you can use I2CWRITE as many times as you need as long as the PIC has enough code space left...
----Important is to can used only one command I2CREAD to read all - text and data -----
Tells me that you MUST read everything you write with one single command.
Which one is it?
Bookmarks