Pages: [1]   Go Down
Author Topic: DS1302 Library error with Due  (Read 2533 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 220
Posts: 13836
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Rob Tillaart

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

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
//*** 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
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 220
Posts: 13836
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Rob Tillaart

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

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

France GARD
Offline Offline
Newbie
*
Karma: 1
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley ).

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 smiley
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 220
Posts: 13836
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

« Last Edit: December 22, 2013, 02:06:39 pm by robtillaart » Logged

Rob Tillaart

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

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 220
Posts: 13836
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Rob Tillaart

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

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 220
Posts: 13836
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry I mixed it up with the 1307,  my mistake

have you tried the 1302 with another board?
Logged

Rob Tillaart

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

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, i have no problem with mega 2560.
Logged

Near Rotterdam in Holland
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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!!!!
Logged

Best regards,

Alban

P.S. sorry for asking silly questions... I'm a mechanical engineer and not an electronics engineer smiley-wink


www.reptile-addict.nl

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, no
The project is in pause actually.
Logged

Near Rotterdam in Holland
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the update!!

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

Best regards,

Alban

P.S. sorry for asking silly questions... I'm a mechanical engineer and not an electronics engineer smiley-wink


www.reptile-addict.nl

Offline Offline
Newbie
*
Karma: 1
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: