TOP Contributors

  1. MIKROE (2779 codes)
  2. Alcides Ramos (376 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (97 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139559 times)
  2. FAT32 Library (72041 times)
  3. Network Ethernet Library (57254 times)
  4. USB Device Library (47607 times)
  5. Network WiFi Library (43219 times)
  6. FT800 Library (42551 times)
  7. GSM click (29930 times)
  8. mikroSDK (28292 times)
  9. PID Library (26930 times)
  10. microSD click (26309 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
Library

All in One - 32 function and sub , RTC ds1307 1307 in Mikroc avr :) (with SoftwareI2c and HardwareI2c Lib)

Rating:

5

Author: Ebrahim Rahmanian

Last Updated: 2018-12-19

Package Version: 1.0.0.1

Category: Timers (Real time clock)

Downloaded: 1281 times

Followed by: 4 users

License: MIT license  

All in One - 32 function and sub , RTC ds1307 1307 in Mikroc avr :)

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "All in One - 32 function and sub , RTC ds1307 1307 in Mikroc avr :) (with SoftwareI2c and HardwareI2c Lib)" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "All in One - 32 function and sub , RTC ds1307 1307 in Mikroc avr :) (with SoftwareI2c and HardwareI2c Lib)" changes.

Do you want to report abuse regarding "All in One - 32 function and sub , RTC ds1307 1307 in Mikroc avr :) (with SoftwareI2c and HardwareI2c Lib)".

  • Information
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

Library Blog

+====================================================================

|1.edit "Defult software I2c Config" code in "Ds1307Mikroc.c"                                                 

|2.include "Ds1307Mikroc.h" in project                                                                                  

|3.call "DS1307_I2C_Init()"                                                                                                   

|4.if is first Run ds1307 then call "Ds1307_play()"                                                                  

|5.Enjoy!                                                                                                                              

|=====================================================================

|Mana Research Group©                                                                                                      

|Simple lib for RTC Ds1307                                                                                                   

|Ver : 940512_1 (2015/8/3)                                                                                                    

|Ebrahim Rahmanian www.mikroc.ir                                                                         

+====================================================================

void DS1307_I2C_Init()

Init  software_i2c

--------------------------------

2

void DS1307_I2C_Stop()

Software I2C stop

--------------------------------

3

char Ds1307_is_play0_pause1()

If return 0 then ds1307 is Pause

If return 1  then ds1307 is Play

--------------------------------

4

void Ds1307_play()

Play ds1307

if is first Run ds1307 then call Ds1307_play()

--------------------------------

5

void Ds1307_pause()

Pause ds1307 time counter

--------------------------------

6

void Ds1307_set_second(char Second_0_59)

Set second

Second_0_59 = 0 … 59

--------------------------------

7

sub Function Ds1307_get_second_0_59() As Byte

Get second

Return 0…59

--------------------------------

8

void Ds1307_set_minute(char Minute_0_59)

Set minuite

Minute_0_59 = 0…59

--------------------------------

9

char Ds1307_get_minute_0_59()

Get minute

Return 0…59

--------------------------------

10

char Ds1307_is_24h_0_12h_1_mode()

If ds1307 is 24h mode then

Return 0 and ds1307 is 12h mode return 1

--------------------------------

11

void Ds1307_set_24h_or_12h_mode(char _24h_0_12h_1)

Set ds1307 to 24h or 12h mode:

If _24h_0_12h_1=0 then 24h mode

Else if _24h_0_12h_1=1 then 12h mode

--------------------------------

12

char Ds1307_is_pm_1_am_0()

If time is am then return 0

If time is pm then return 1

This Function worked in 24h and 12h mode.

--------------------------------

13

char Ds1307_get_hour_0_23()

Get Hour

Return 0…23

This Function worked in 24h and 12h mode.

--------------------------------

14

char Ds1307_get_hour_0_12()

Get Hour

Return 0…12

If is 0:00Am retrun 0

Then is 12:00pm Return 12

And otherwise is 1…11

This Function worked in 24h and 12h mode.

--------------------------------

15

void Ds1307_set_hour_0_23(char Hour_0_23 )

Set Hour

Hour_0_23 = 0…23

This Function worked in 24h and 12h mode.

--------------------------------

16

void  Ds1307_set_hour_0_12(char Hour_0_12, char Am0_pm1 )

Set Hour

Hour_0_12  = 0…12

Am0_pm1 = 0 or 1

0 is AM and 1 is Pm

This Function worked in 24h and 12h mode.

--------------------------------

17

char Ds1307_get_dayofweek_1_7()

Get Day of Week

Return 1…7

1 is first day of week and 7 is Last day of week.

--------------------------------

18

void Ds1307_set_dayofweek(char Dayofweek_1_7)

Set day Of week

Dayofweek_1_7 = 1…7

1 is first day of week and 7 is Last day of week.

--------------------------------

19

char Ds1307_get_dayofmonth_1_31()

Get day Of Month

Return 1…31

--------------------------------

20

void Ds1307_set_dayofmonth(char Dayofmonth_1_31)

Set Day Of Month

Dayofmonth_1_31 = 1…31

--------------------------------

21

char Ds1307_get_monthofyear_1_12()

Get Month Of Year

Return 1…12

Ex)

1 is “jan” and 12 is “Dec”

--------------------------------

22

void Ds1307_set_monthofyear(char Monthofyear_1_12)

Set Month of Year

Monthofyear_1_12 = 1…12

Ex)

1 is “jan” and 12 is “Dec”

--------------------------------

23

char Ds1307_get_year_0_99()

Get Year

Return 0…99

0 is 2000 and 99 is 2099

--------------------------------

24

void Ds1307_set_year(char Year_0_99)

Set Year

Year_0_99 = 0…99

0 is 2000 and 99 is 2099

--------------------------------

25

void Ds1307_external_1hz_on()

External 1hz Clock on

(ds1307 sqw/out pin)

Please Read Ds1307 DataSheet

--------------------------------

26

void Ds1307_external_4096hz_on()

External 4096hz Clock on

(ds1307 sqw/out pin)

Please Read Ds1307 DataSheet

--------------------------------

27

void Ds1307_external_8192hz_on()

External 8192hz Clock on

(ds1307 sqw/out pin)

Please Read Ds1307 DataSheet

--------------------------------

28

void Ds1307_external_32768hz_on()

External 32768hz Clock on

(ds1307 sqw/out pin)

Please Read Ds1307 DataSheet

--------------------------------

29

void Ds1307_external_off_sqwe_0()

Set External Clock Off

And Digital Level of SQWE pin set 0

Please Read Ds1307 DataSheet

--------------------------------

30

void Ds1307_external_off_sqwe_1()

Set External Clock Off

And Digital Level of SQWE pin set 1

Please Read Ds1307 DataSheet

--------------------------------

31

char Ds1307_read_ram(char Ram_byte_index_0_55)

Read byte in ds1307 Ram

Ram_byte_index_0_55= 0…55 address of ram

--------------------------------

32

void Ds1307_write_ram(char Ram_byte_index_0_55 ,char Value)

Write byte in ds1307 Ram

Ram_byte_index_0_55= 0…55 address of ram

Value = value!

 

 

www.Mikroc.ir

E.Rahmanian

2015

ALSO FROM THIS AUTHOR

All in One_85Function_Button and keypad1*1 ... 9*9key Lib

0

All in One_Button and keypad1*1 ... 9*9key Lib

[Learn More]

This Code is 250% Faster! Than Default StrCpy() subroutine for mikroc AVR

0

This Code is 250% Faster! Than Default StrCpy() subroutine for mikroc AVR

[Learn More]

All in One_ Save And Read Data to Internal Flash Memory_Stm32

0

Save And Read Data to Internal Flash Memory_Stm32 with Example for Stm32f030f4

[Learn More]