could anyone confirm the above.... i kinda need to know quite quickly.
Snood
could anyone confirm the above.... i kinda need to know quite quickly.
Snood
That'll work fine to set bit.7 assuming your I2C write is working properly.
Program the chip and give it a go.
Arch
okay, ive added in the pullup resistors, ive ensured everything is connected to the correct things, ive made sure that i am addressing correctly, as far as i can see, i'm doing everything as i should.... now when i try set the time/dats as above and then read it back i get the values "16"
this is also true of the i2C EEPROM i am using on the same bus.
any ideas?
Snood
edit: i just thought that the value 16 is a hex "F" any ideas?
Last edited by snood; - 25th April 2005 at 19:00.
Snood,
this is a perfect time to have a look at the datasheet and the examples you have got.
If you are expecting any further assistance post your schematic and code.
(please cut the code down to the minimum required for reading writing the RTC / EEPROM)
But before posting please do some reading!
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
please..... i have read the data sheet over and over again, ive read various places about I2C and i have studied the sample codes that i have been pointed to and still not a clue
TRISB = %11111111
second VAR BYTE
minute VAR BYTE
hour VAR BYTE
day VAR BYTE
date VAR BYTE
month VAR BYTE
year VAR BYTE
ITCDEVICE VAR BYTE
ITCADDRESS VAR WORD
SDA VAR PORTC.4
SCL VAR PORTC.3
ITCDEVICE = $D0
ITCADDRESS = $00
second = 0
minute = 0
hour = 12
day = 2
date = 25
year = 5
I2CWrite SDA, SCL, ITCDEVICE, ITCADDRESS, [second, minute, hour, day, date, month, year]
Pause 500
I2CRead SDA, SCL, ITCDEVICE, ITCADDRESS, [second, minute, hour, day, date, month, year]
at this point i dend the variables to my LCD and what comes up on the screen is "16"
thanks
Snood
edit: it's been suggested to me that as i'm recieving "16" or a single "f" that maybe something is holding the data line up? still clueless other than that
the RTC requires a BYTE address, not WORD !Code:ITCADDRESS VAR WORD
1. there is no explicit value in "month"Code:second = 0 minute = 0 hour = 12 day = 2 date = 25 year = 5 I2CWrite SDA, SCL, ITCDEVICE, ITCADDRESS, [second, minute, hour, day, date, month, year]
2. the RTC uses BCD format, the decimal values you are writing to the RTC don't make much sense.
-----
Now it's up to you to find out what the correct format would look like.
without a schematic we can't helpit's been suggested to me that as i'm recieving "16" or a single "f" that maybe something is holding the data line up? still clueless other than that
You have already got more information than you would ever need to solve this problem.
Do some work on your own.
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
the pic will automaticaly transmit the numbers in BCD.... even mel uses just regular numbers... and the missing month value is just a typing error, it is infact in my program.
a direct quote from the DS1307 datasheet:
"After the DS1307 acknowledges the slave address + write bit, the master transmits a word address to the DS1307."
WORD address
as fror the schematic... it's connected in the same fassion as the typical operating citcuit in the datasheet with 4k7 pullups... the Square wawe pin is just left hanging as i'm not using it.
please stop telling me to do my own work... the questions i ask are simply what i cant find myself so i'm calling upon the expertese of other people. if you dont know how to solve my problem then just say so.
Snood
Bookmarks