Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

eurotimedate Query

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
abifar1

Bascom Member



Joined: 08 Aug 2005
Posts: 66
Location: Austria

austria.gif
PostPosted: Wed Aug 02, 2006 8:31 pm    Post subject: eurotimedate Query Reply with quote

Hi

I need a tip about how using "eurotimedate.lib" because I use RTC ds1307 and this code for date format same as "02/27/06" :

$lib "ds1307.lib"
$lib "eurotimedate.lib"
Config Clock = User
Config Date = Mdy , Separator = /

but problem is when I change Conifg to :
Config Date = dmy , Separator = .

it does not effect and date format is same as before "02/27/06" !! Shocked
what I am doing wrong ? can anybody tell me ?
Back to top
View user's profile Yahoo Messenger
DToolan

Bascom Member



Joined: 14 Aug 2004
Posts: 1384
Location: Dallas / Fort Worth, Texas (USA)

blank.gif
PostPosted: Wed Aug 02, 2006 10:02 pm    Post subject: Reply with quote

You are mixing too many statements that are competing for control and the ds1307.lib is winning. If you want to use the ds1307.lib, it is preset for MM/DD/YY display.

If you want to use the eurotimedate.lib, it is preset for DD-MM-YY (no periods as seperators).

Your "CONFIG DATE =" statements seem to have no effect if you use any $lib designed to do Date$ control.
Back to top
View user's profile Yahoo Messenger
ATIU

Bascom Member



Joined: 15 Oct 2004
Posts: 528

philippines.gif
PostPosted: Wed Aug 02, 2006 10:52 pm    Post subject: Reply with quote

You can probably combine both libraries, cut and paste, and modify the separator as well. Open the library and it should be pretty staight forward since its very well commented/documented.
Back to top
View user's profile
kimmi

Moderator



Joined: 24 Feb 2006
Posts: 1922
Location: Denmark

denmark.gif
PostPosted: Thu Aug 03, 2006 1:01 am    Post subject: Reply with quote

hi ...
try this Rolling Eyes

Code:


$regfile = "m8def.dat"
$crystal = 4000000
$baud = 19200
$hwstack = 32
$swstack = 10
$framesize = 40
Dim A As Byte
Enable Interrupts

'[now init the clock]

Config Date = Dmy , Separator = .       ' Dmy not dmy
Config Clock = Soft                     'this is how simple it is


'The format is DD/MM/YY

'Date$ = "03.08.06"
' Time$ = "02:20:00"


'test on date  Day step up every sec
A = 1

Do
_day = A'  a seep date by 1 to see it is ok
_month = 08
_year = 06

  Print Date$ ; "  " ; Time$            'show the date and time
Wait 1
A = A + 1
If A > 31 Then A = 1
Loop

End
Rolling Eyes
_________________
/ Kim
Back to top
View user's profile Visit poster's website MSN Messenger
kimmi

Moderator



Joined: 24 Feb 2006
Posts: 1922
Location: Denmark

denmark.gif
PostPosted: Thu Aug 03, 2006 1:42 am    Post subject: Reply with quote

this work ok to
Code:

$regfile = "m32def.dat"
$crystal = 8000000
$baud = 19200
$hwstack = 32
$swstack = 10
$framesize = 40

$lib "ds1307rtc.lib"
'$lib "eurotimedate.lib"

Dim A As Byte
Enable Interrupts

'[now init the clock]

Config Date = Dmy , Separator = .       ' ANSI-Format
Config Clock = Soft                     'this is how simple it is


'The format is DD/MM/YY

Date$ = "03.08.06"
'Time$ = "02:20:00"


'test on date  Day step up every sec
A = 1

Do
_day = A

  Print Date$ ; "  " ; Time$            'show the date and time
Wait 1
A = A + 1
If A > 31 Then A = 1
Loop

End
Shocked

01.08.06 02:20:00
02.08.06 02:20:30



Code:
$regfile = "m32def.dat"
$crystal = 8000000
$baud = 19200
$hwstack = 32
$swstack = 10
$framesize = 40

$lib "ds1307rtc.lib"
'$lib "eurotimedate.lib"

Dim A As Byte
Enable Interrupts

'[now init the clock]

Config Date = Mdy , Separator = .       ' ANSI-Format
Config Clock = Soft                     'this is how simple it is


'The format is MM/DD/YY

Date$ = "03.08.06"
'Time$ = "02:20:00"


'test on date  Day step up every sec
A = 1

Do
_day = A

  Print Date$ ; "  " ; Time$            'show the date and time
Wait 1
A = A + 1
If A > 31 Then A = 1
Loop

End


03.01.06 02:21:11
03.02.06 02:21:12

_________________
/ Kim
Back to top
View user's profile Visit poster's website MSN Messenger
abifar1

Bascom Member



Joined: 08 Aug 2005
Posts: 66
Location: Austria

austria.gif
PostPosted: Thu Aug 03, 2006 12:02 pm    Post subject: Reply with quote

DToolan and ATIU Thank you very much I think your right I should change in DS1307.lib but it is a pittule difficult for me because I dont know too much Assbmly . I am trying if it works I tell you .
but I think easiest way for me is just change string or DATE by a Sub in Bascom .

KIMMI I dont get what are codes you are writnig seems you did not get the query !! Exclamation
Back to top
View user's profile Yahoo Messenger
kimmi

Moderator



Joined: 24 Feb 2006
Posts: 1922
Location: Denmark

denmark.gif
PostPosted: Thu Aug 03, 2006 2:51 pm    Post subject: Reply with quote

ohhh sorry

Do you have Phil´s ds1307rtc.lib ?

'get date & time from the DS1307 & convert it to binary & stick it in the
'global variables _sec, _min, _hour, _day, _month. _year
'This routine is called automaticly whenever the "Date$" or "Time$" is read. (I guess, because it is not documented)
'This routine must be called maunally, just prior to, whenever a other time & date routines are used,
'eg "SysSecElapsed" & "SysSec()"

_________________
/ Kim
Back to top
View user's profile Visit poster's website MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum