DS1307 Real Time Clock Utility

Go To Last Post
24 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've updated this Academy project. Updated for WINAVR 20060125 (use FDEV_SETUP_STREAM instead of fdevopen) and some bug fixes.

Don

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Don,

Thanks for the update. It is working fine with my ATMega8 running at 10 MHz..

Vince
Ilion, NY

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Vince330 wrote:
Thanks for the update. It is working fine with my ATMega8 running at 10 MHz.

You're welcome. Glad to hear it's working fine running at 10 MHz. Nice to hear from you again.

Don

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

please tell me how to programing RTC with Atmega88 and display time on LCD.
Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

cyberdepart wrote:
please tell me how to programing RTC with Atmega88 and display time on LCD.
Thanks

Trying to stay on topic...
Don's project will show you how to use the AVR's TWI module to communicate with a DS1307 real-time clock.

Is this the real-time clock you're using? If so, then you're in luck! You will be able to use some of Don's code as a reference for your own.

Don't forget to give him credit for any code you copy verbatim!

Do you have working LCD software already? If so, then it's just a matter of cobbling parts of Don's code with your working LCD software along with a little of your own glue code to make everything work.

If you don't have working LCD software already, then this is the wrong place to look for it, since that issue has nothing at all to do with Don's project.

Depending on the model of LCD controller you're using, some additional seraching may bring up some reference software for writing an LCD driver appropriate to your hardware. Otherwise, general questions (not related to a specific Academy project) should be posted in the main AVR technical forum.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi
is any body here to help me too make some clock with ds1307 or not???'

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Which bit of Don's project are you having a problem with exactly?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Don,

Thanks for posting the ds1307 project. I am trying to get it running on a Mega32 at 8MHz (can crystal in the STK500 crystal socket). I have run into a problem that I can't seem to solve. The uC is in an STK500 with a couple of I2C wires running to the 1307 on an adjacent breadboard. 4.7K pull ups on the breadboard. The code is running because I get the "Enter h for help" message, also the terminal echos sent characters. However, that is all it does. The code seems to be stuck in the uartGetChar() routine constantly looping back to the UART looking for a command code that it does not get. Yet, when I send a character to the UART, it echos back on TXD and displays correctly on the terminal screen. I put a scope on RXD and I can see the ASCII character arrive. There is no action on the I2C because the code never gets that far.

Any ideas?

Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jimlake wrote:
The code seems to be stuck in the uartGetChar() routine constantly looping back to the UART looking for a command code that it does not get. Yet, when I send a character to the UART, it echos back on TXD and displays correctly on the terminal screen.
If the code is echoing the received character, then it's not stuck in the uartGetChar() routine.

Note that the code is looking for more than just a command code - it's looking for a command string. Are you ending the sequence with a carriage return (i.e., Enter key)?

Don

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hmmm, no...what do you normally type in to the "send" bar of your rs232 terminal when you want to send a command code? I am using Bray terminal. I have been just typing an "h" or "?" or whatever into the send buffer and pushing the "send" button. All that goes out is the character. No CR/LF. Pardon the ignorance- What should I be doing?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Make a "Transmit Macro", e.g., type in #013 for macro 1, you can now send a CR using the F1 key or by clicking the M1 button.
/Lars

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yee Gawd, how I tore my hair out trying to figure out why it wouldn't work when all it lacked was a CR. Thank you for allowing me to keep what's left.

Jim

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

donblake wrote:
I've updated this Academy project. Updated for WINAVR 20060125 (use FDEV_SETUP_STREAM instead of fdevopen) and some bug fixes.

Don

Firstly, thanks for posting about RTC DS1307.

but how about making Real Time with DS12C887. I need to know a lot about that. I am very curios about that. :roll: anybody can help me with the WinAVR code or CV AVR code? hopefully with the schematic :D

ArcticSoul
Industrial Electronic Engineering, College Student

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thanks
but how about making Real Time with DS12C887 with atmega 8515L. I need to know a lot about that. I am very curios about that,
anybody can help me? zyadz@ymail.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You seem curios about a lot of things, so do your googling and reseach. And no one will be crazy enough to reply to your email address I hope.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
And no one will be crazy enough to reply to your email address I hope.
Actually, spam bots will provide him with a lot of good tips on various subjects...

There are pointy haired bald people.
Time flies when you have a bad prescaler selected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi There!

Great project. Thanks Don!

Has anyone tried porting to a ATtiny2313? It has the USART, not the UART.

-fab

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have ported to the M324p/M644p. You only need to change the names for the USART.
HOWEVER it also uses a real TWI which is not present in the Tiny2313, so it will be somewhat messy using a bit banged or USI TWI. Doable but time consuming, so when YOU do it please share it with us. :)

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok John, should I succeed I'll gladly share with everyone.

-fab

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Gentlemen,
Sorry to bring up an old thread again, but I ned a little assistance to find Don's project?
I'm looking in to connecting an DS3231 to my Atmega32, and I do need a puch to get me started.. like an old car :-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

but I ned a little assistance to find Don's project?

http://www.avrfreaks.net/index.p...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, Clawson :-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What should I do if I want to add an alarm function to this program? I am doing a project on the same topic(using i2c create a clock/calendar display with a multiple alarm function). I am using AtMega64 board for this. Can any1 help me with this?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Would you not just use a DS1337 or similar in place of the DS1307? It supports two alarms and on the Maxim site the DS1307 is $1.39 while the DS1337 is $0.88