EmbDev.net

Forum: FPGA, VHDL & Verilog DS1305 and vhdl


Author: Max Fed (maxfed)
Posted on:

Rate this post
0 useful
not useful
Hi all! I need to work with RTC DS1305 with Quartus (vhdl), can anybody 
show me some examples? thnx

Author: Lothar Miller (lkmiller) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Max Fed wrote:
> RTC DS1305
Excerpt from datasheet: Supports Motorola SPI
Then have a look at this (with google translator): 
http://www.lothar-miller.de/s9y/categories/45-SPI-Master

Author: maxfed (Guest)
Posted on:

Rate this post
0 useful
not useful
Lothar Miller wrote:
> Then have a look at this (with google translator):
> http://www.lothar-miller.de/s9y/categories/45-SPI-Master

Lothar, thank you for your code!
One more question:

Excerpt from datasheet:
HEX ADDRESS
READ WRITE Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 RANGE
00h   80h   0    10 Seconds       Seconds          00–59
01h   81h   0    10 Minutes       Minutes          00–59

So, how I write 0-s in seconds? Can you write in 2-3 lines of code? And 
I'll understand all :))

: Edited by Moderator
Author: Lothar Miller (lkmiller) (Moderator)
Posted on:

Rate this post
0 useful
not useful
maxfed wrote:
> So, how I write 0-s in seconds?
Have a look at "Figure 6. SPI SINGLE-BYTE WRITE"
You will need a 16 bit transfer with first byte is the address x"80" and 
the second byte is x"00".
When you use my SPI master as a component in your toplevel design, then 
you have just to write:
   TX_Data  <= x"8000";
   TX_Start <= '1';
It gets more tricky if you want to access several registers one after 
the other, because this successive access must be done by a state 
machine: steps are always the same: config a transmission, start the 
transmission, wait for the transmissions end, then config a 
transmission, start it, wait for its end, and so on.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.