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.
yeah, im also using ccs compiler but the demo version only, i checked the pic-c help section and found that the #pragma is available to use, what should I do with it??
and the code that you provided, what are the values that will be placed in the time[]?
for further info, I checked and asked...
Thanks for the very quick repliy, well, I tried using my own method that I thought of, not sure if its optimized or encouraged to do, but basically, what I did is that I store the time in the RAM of the DS1307, then whenever the MCU starts, it will read the stored time in the DS1307 and save it...
Clarify:
1.) By output pin, u mean pin7 ryt? so the configuration that I would need is to enable a 1hz that is coming out of the DS1307? so by checking it, I would have a wire connected to it and placed at something like portb(1) then check if there is an input there?
e.g.
if(portb(1) != 1)...
Thanks it worked, I forgot the initialization of the CH bit... got confused with the D0, thought that was the one being written on seconds :D
Another EDIT:
I got it to work finally, but, just a side question, what should I check/bit test to see if there is a time already placed inside the RTC...
I have a problem with the code that I found and modified a bit to suit the ccs c compiler
I tried printing out the hours:min:secs and what I got was -1:-1:-1
I checked before the variable secs was used in the writing sequence of the i2c and saw that it is still fine (55)
Is there something...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.