hello everyone.i'm new here, i would like to ask for some assistance regarding my project, which on interfacing DS1307 with 16F877. basically i will be using this on my programmable medicine dispenser, and i need DS1307 as my clock source and synchronization so that the medications will always be on time. how do i call the DS1307 so that if a preset time is reached (input through keypad), the microcontroller will signal an alarm and a blinking LED indicator?Thanks!Elizabeth Ann
how do i set the microcontroller to sleep mode?
#asm SLEEP#endasm
You let the MCU execute a "SLEEP" instruction. Since it is an assembly language instruction and in CCS C, you insert the ff. line of codeCode: [Select]#asm SLEEP#endasmBefore you execute the sleep instruction, make sure the PIC can wake up from sleep. One way is to enable interrupts for particular event such as the interrupt pin, key press or timer interrupt. Is the device you are making battery operated? That is the most common use to put to sleep an MCU, to conserve power by shutting down the MCU to conserve power.Are you forced to use the DS1307? If not why not use the more common clock chip found in the PC's like the DS12887 or similar parts. It has a buillt-in alarm, crystal and battery.
No, the device that we are constructing is not battery-operated. is the DS12887 i2c-compatible?
Code: [Select]No, the device that we are constructing is not battery-operated. is the DS12887 i2c-compatible?Then why do you want to put the PIC to sleep? You can let the PIC constantly poll the DS1307 at least once a second or even faster. There is no harm done by letting it work its idle time off. This way you don't worry about interrupts and stuff. Why do you need i2c compatibility? Did someone require you to do that? Do you already have the DS1307 on hand? If not, maybe there are more readily available parts you can cannibalize from old PC's.
tama ang mga masters, you have to regularly poll ds1307, para macheck ang time, may ginawa akong automatic water sprayer operates like that pero DS1302 ginamit ko, SPI kaya madali, meron itong 32 bytes ram na pwede isave ang time settings in case of power failure, meron din trickle charging option para sa back up battery. lab na lab ko kasi mga halaman ko kaya ginawan ko neto, may rain sensor para isara ang kulambo sasara kung umuulan, meron din LM35DZ temp sensor para isara ang kulambo kung mainit, pede iset kung ano oras magdidilig at gaano katagal at kung anong gustong temperatura.
thanks everyone for the patience and attention...hihi... by the way, i have been reading the datasheet of DS1307 and it just proved you guys right, we need to keep a monitored record of the time. you're right, maybe i can poll the DS1307 from time to time.yes i already have samples of DS1307 from Maxim (is it ok to mention the company?Lol i just did!)by the way, to make things more complicated, i will be needing that same program/routine for a total of 100 medicine dispensers. that's what my project is, in a nutshell. i will be using Port Expanders (specifically MAX7318) to handle all the keypad inputs in just one microcontroller, so that i don't have to complicate the task with letting micros communicate with each other.are there any better ideas? please i would love to hear them. thank you...elizabeth ann
product ba yan ng company nyo? you will be able to reduce your BOM cost by just eliminating the MAX7318 and creating instead a 4X4 Hex Keypad Matrix using 8bits of port...
yes bosing, as soon as mafinalize lahat at madouble check namin for errors, ishishare po namin lahat yun.meanwhile, i hope i get a chance to post some of the rtc/scheduling routines when i come back online sometime later.