DS1302 Library error with Due

Hello, I am using a DS1302 (Real Time Clock on 3 pins). The library work great on Mega 2560 but on Due, I have the error message: NHC_5_Due:119: error: expected ')' before '' token NHC_5_Due:119: error: expected ')' before '' token

The line 119 is:

DS1302 RTC(CE, IO, SCLK);            //DS1302

And the line 118 is:

UTouch myTouch(6,5,4,3,2);           //Tactile

If I comment the line 119, there is no problem to compile the code. Is a problem from the lib? Do you have a link to download a correct lib DS1302 for DUE?

which 1302 library are you using, there are many around, please provide

  • a link to the library used
  • your code to see how it is called

There is the link: https://github.com/ringerc/Arduino-DHT22 It come from: http://playground.arduino.cc/Main/DHTLib

The libray work great with Mega 2560, but to compile it for Due (Programming Port), there is that error.

//*** DS1302 ***
const byte CE = 54;              //[X] DS1302   
const byte IO = 55;              //[X] DS1302 
const byte SCLK = 56;            //[X] DS1302 

DS1302 RTC(CE, IO, SCLK);            //DS1302

That are links for temperature sensors, not links to an 1302 RTC ...

robtillaart: which 1302 library are you using, there are many around, please provide - a link to the library used - your code to see how it is called

Oh! Sorry :blush: . It's come from: http://www.henningkarlsen.com/electronics/library.php?id=5.

Very Usefull this Lib , I only find this one for the 1302 , why does nobody intresting on this chip ? ( or I don't read the right side of the Forum :) ).

It Works on a freeduino , but sorry I don't own a Arduino Due , so I cannot answer at this time , I will come back here when My arduino 2650 will be at home , I ordered one last week :)

nono7380: Oh! Sorry :blush: . It's come from: http://www.henningkarlsen.com/electronics/library.php?id=5.

On that page: Compatibility:

v Arduino Duemilanove w/ATmega328 v Arduino Uno ? Arduino Leonardo v Arduino Mega v Arduino Mega2560 ? Arduino Due ? Bobuino

This indicates that Due is (at least) not tested imho.

Update: 1) there were problems with the DUe I2C implementation in the past - http://forum.arduino.cc/index.php?topic=146802.0 - don't know if they are solved (check release notes)

2) The Due is a 3.3Volt device, do not know if the 1302 works well on this level. Check the datasheet.

Hello,
DS1302 is not a i2c interface, it’s a 3 pins interface.
DS1302 support 2 to 5.5 Volts.

I got the message when I try to verify the code.

Sorry I mixed it up with the 1307, my mistake

have you tried the 1302 with another board?

Yes, i have no problem with mega 2560.

did you get it running???

I usually use the same library with my DS1302 on a Mega2560 and/or Uno but on my Due I get no proper date/time. No error either....

If you got your DS1302 running on your Due I would like to know how you did it!!!!

Sorry, no The project is in pause actually.

Thanks for the update!!

I got my DS1307 working so I'm good now..

so… there’s no way to make the DUE works with the DS1302?
i have the same problem, using the library and others codes i have found on the NET, i can’t make it works on due, no compilation error, but no response of the DS1302. (on duemilanove works great). isn’t a problem of voltage, i probe that on duemilanove (working on 3.3 V) and works fine.

DS1302 it’s a great RTC because don’t need any bus of the micro, just 3 D I/O.