No, I will use 4 buttons, 1. Set 2. Inc 3. Dec 4. OK
Set will position the cursor on dd mm yy hh mm ss and cycles from dd to ss
Inc and Dec will increment of decrement the values
OK will accept the changes and starts the clock from new settings.
Check these links http://www.mikroe.com/forum/viewtopic.php?t=15813
http://www.mikroe.com/forum/viewtopic.php?p=84795
Finally, what PIC are you using for your project. I want to know because I have to set ADCON1 register.
Your project is almost complete, but the inc and dec is not happening as expected. maybe it is using hex values
I attach the files.
press set button to enter time setting mode, then pressing set button successively will cycle through week_day, day, month, year, hour, min, sec.
which parameter is chosen that parameter can be incremented or decremented in their own ranges using inc and dec buttons.
after settings has been done press OK button to enter normal time displaying mode.
I will try to implement alarm after this inc and dec problem gets solved.
Check these links http://www.mikroe.com/forum/viewtopic.php?t=15813
http://www.mikroe.com/forum/viewtopic.php?p=84795
Finally, what PIC are you using for your project. I want to know because I have to set ADCON1 register.
Your project is almost complete, but the inc and dec is not happening as expected. maybe it is using hex values
I attach the files.
press set button to enter time setting mode, then pressing set button successively will cycle through week_day, day, month, year, hour, min, sec.
which parameter is chosen that parameter can be incremented or decremented in their own ranges using inc and dec buttons.
after settings has been done press OK button to enter normal time displaying mode.
I will try to implement alarm after this inc and dec problem gets solved.
Check the simulation attached in my last post.
I2Cx_Wr() takes hex values as argument. The problem is my counters use decimal values. I think that is causing the problem.
I have attached the Schematic. What happened to Proteus I sent. Why are you not using it?
Can you send me the decimal value 0 to 89 and its equivalent hex value. I have to finish your project.
I checked that ds1307 gives decimal values from 0 to 99. 0x63 = d99 for year 2099.
so please send me the decimal values 0 - 99 and its equivalent hex values.
Please check the simulation and tell me if it is OK. earlier I thought about setting time from current time, ie., if you enter set mode it will be showing the time it was showing before entering the set mode. I got some problems with that, so I made such that all values will be 00 when set mode is selected.
I have programmed the inc, set, and ok buttons. I still have to code the dec button. please check it anf tell me if it is ok.
Maybe it is because of your Proteus. I don't see any problem here. It is working properly. Tomorrow I will post a video of that.
Check this simulation. I have done dec for day and month. I still have to do dec code for year, hour, min.
Seconds cannot be set, because there is no option to write seconds to ds1307 using I2cx_Wr() function. So you can only set weekday, day, month, year, hour, and minute.
Try to use proteus I sent. It works properly.
OK. It is almost finished. I have done dec coding for weekday, day, month, hour, minute. Only the year has to be coded. Please install Proteus 7.10 and check the simulation. I have compiled the code for 8 MHz. I think if you compile for other clock frequencies you may need to change the debounce delay.
-------------------Update----------------------
It is finished. I have not used blinking cursor. I will try to implement it tomorrow. If possible I will also implement the alarm.
explain when actually the problem occurs. can you zip and post your .dsn file?
Yes, there is a problem in horm maybe in others also. I saw that after 10 it goes to 15 in hour. I will try to fix it.
I tried many ways to use the 12 hour format, but couldn't get it. I don't know what value to be written to hour register to make it work in 12 hour format. Anyway I have tried to fix the inc problem in all the parameters. Check it and tell me if it is working properly. I have attached the files in my last post. after that check with dec also. If you mention the problems I will fix it tomorrow.
I can remove the AM/PM if you don't want it in 24 hr format, but I can't code the 12 hr format. If you have any example code of setting rtc to 12 hr format, send it to me.
Check the simulation in my last post. see if the errors are fixed. Read my last post it is updated.
There is one more problem. If you increment to values 16+, 32+, 48+, 63+ and decrement it it decrements a value of 6. It is happening because of decimal to hex conversion. i will fix it tomorrow.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?