Go Down

Topic: DS1302 Library error with Due (Read 2883 times) previous topic - next topic

nono7380

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:
Code: [Select]
DS1302 RTC(CE, IO, SCLK);            //DS1302
And the line 118 is:
Code: [Select]
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?

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
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

nono7380

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.

Code: [Select]
//*** 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

robtillaart

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


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
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)


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 :)

robtillaart

#6
Dec 22, 2013, 07:53 pm Last Edit: Dec 22, 2013, 08:06 pm by robtillaart Reason: 1

Oh! Sorry  :smiley-red: .
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.

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

robtillaart

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.
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

nono7380

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.

robtillaart

Sorry I mixed it up with the 1307,  my mistake

have you tried the 1302 with another board?
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

nono7380

Yes, i have no problem with mega 2560.

Alban

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!!!!
Best regards,

Alban

P.S. sorry for asking silly questions... I'm a mechanical engineer and not an electronics engineer ;)


www.reptile-addict.nl

nono7380

Sorry, no
The project is in pause actually.

Alban

Thanks for the update!!

I got my DS1307 working so I'm good now..
Best regards,

Alban

P.S. sorry for asking silly questions... I'm a mechanical engineer and not an electronics engineer ;)


www.reptile-addict.nl

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.

Go Up