Strange results from RTC!!!!!

Status
Not open for further replies.

tkvenki

New Member
Hi All,

I have written a code to write and read from the RTC chip DS1305. I'm using VS2000 as my SPI master. After Writing some data to the RTC. When I try to read it I'm getting the following output. I observed the waveforms are also in accordance with the output.
--------------------------------------------------------------------------
Output:
Starting SPI application................
The device SPI is opened
Configuration is successfully set!!
After Read --> 255 0 0 0 0 128 128
------------------------------------------
After Read --> 255 0 0 0 0 128 128
------------------------------------------
After Read --> 255 0 0 0 0 128 128
------------------------------------------
--------------------------------------------------------------------------
Please find the code attached to this post. Please let me know if there is some obvious mistakes. Also suggest me some hardware issues that i can look into.
 

Attachments

  • spi.c
    2.8 KB · Views: 173
Problem Solved......

Hi All,

I got the solution for my problem.
The issue was basically with the setting of Clock Phase and Clock Polarity.

For DS1305 the settings are:
Config_t.bClockPolarity = DCT_CONST_SPI_CLOCK_POL_LOW;
Config_t.bClockPhase = DCT_CONST_SPI_CLOCK_PHA_HIGH;

Anybody who wants to test the DS1305, can use the code attached in my previous post, with the changes in the settings mentioned above.

Best Regards
Venki
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…