how to set the database in PIC?

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

how to set the database in PIC?

Postby IsaacChuah90 » Sun Jun 26, 2011 10:14 pm

I'm doing an alarm clock system and I want to set the time for my alarm clock to ring every morning.So how can I set the database in my PIC?I'm using PIC16F877A.Seeking for helps.Thanks.
IsaacChuah90
Apprentice
 
Posts: 52
Joined: Mon Jun 06, 2011 7:35 pm

Re: how to set the database in PIC?

Postby Brian Griffin » Sun Jun 26, 2011 10:31 pm

IsaacChuah90 WROTE:I'm doing an alarm clock system and I want to set the time for my alarm clock to ring every morning.So how can I set the database in my PIC?I'm using PIC16F877A.Seeking for helps.Thanks.


As a starter, try the pseudocode:

CODE: SELECT_ALL_CODE
if ( current time == alarm time )
    RingAlarm();
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Re: how to set the database in PIC?

Postby IsaacChuah90 » Sun Jun 26, 2011 11:27 pm

Ya.I got it.But if I want to make the clock as a smart system?just like what the cell phone can do.the phone can save the time for the alarm clock to ring every morning from monday until sunday.This is the database I want to set in my PIC.Anything programmer or coding can do this?thanks.
IsaacChuah90
Apprentice
 
Posts: 52
Joined: Mon Jun 06, 2011 7:35 pm

Re: how to set the database in PIC?

Postby shahrul » Sun Jun 26, 2011 11:55 pm

IsaacChuah90 WROTE:Ya.I got it.But if I want to make the clock as a smart system?just like what the cell phone can do.the phone can save the time for the alarm clock to ring every morning from monday until sunday.This is the database I want to set in my PIC.Anything programmer or coding can do this?thanks.

Yes, all the data you can save in variable or you can use in EEPROM.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: how to set the database in PIC?

Postby IsaacChuah90 » Sun Jun 26, 2011 11:58 pm

Oh.So what programmer to use?C programming or Visual Basic?The database is link with the real time clock that is connected to the PIC.
IsaacChuah90
Apprentice
 
Posts: 52
Joined: Mon Jun 06, 2011 7:35 pm

Re: how to set the database in PIC?

Postby temporary40 » Mon Jun 27, 2011 10:05 am

Isaac,

I think the word "database" is inappropriate. Database usually refers to a large data storage system for example, Item, Stock, People, like "Employee's Database" or "Stock Database".

What you want is just an alarm clock, I presume. Like in previous post, you will just need EEPROM to store the memory or you no need at all if you do not turn off your alarm clock. (You can use the sleep feature in the PIC).

My advice, you need to tackle the hardware and software. Hardware, you need to have a proper circuitry. Just grab a cytron MBXX and you will do fine.

About the software, you will need simple software engineering skills. Design your requirement and implement a proper algorithm. I would recommend finite state machine because it is easier.

You can use MPLAB IDE as your software development tool with MPLAB C Compiler (it is free from Microchip Technology) and use any programmer from Cytron to boot your program in the chip and you are done.
temporary40
Novice
 
Posts: 23
Joined: Thu Apr 01, 2010 9:30 pm

Re: how to set the database in PIC?

Postby Brian Griffin » Mon Jun 27, 2011 10:59 am

There is no database involved.

If stuff permits, use an I2C EEPROM alongside with the DS1307 Real Time Clock to store desired alarm values. If you don't like the values, you can simply delete it in the EEPROM.

A 1~2 kilobits EEPROM will do.
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Re: how to set the database in PIC?

Postby IsaacChuah90 » Mon Jun 27, 2011 11:35 am

Oh..thanks a lot guys.I2C EEPROM alongside with RTC DS1320?other than that can?for example DS1304 or DS1307?thanks.
IsaacChuah90
Apprentice
 
Posts: 52
Joined: Mon Jun 06, 2011 7:35 pm

Re: how to set the database in PIC?

Postby Brian Griffin » Mon Jun 27, 2011 11:43 am

IsaacChuah90 WROTE:Oh..thanks a lot guys.I2C EEPROM alongside with RTC DS1320?other than that can?for example DS1304 or DS1307?thanks.


Sorry, it should be DS1307, not DS1320. It's easily available in Cytron.

If you do not want to use the EEPROM, you can use the microcontroller to store the alarm times.
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Re: how to set the database in PIC?

Postby IsaacChuah90 » Mon Jun 27, 2011 7:37 pm

microcontroller to store the alarm times?compare with EEPROM,which 1 is better?Because I need to store many alarm time in my alarm clock from monday to sunday.
IsaacChuah90
Apprentice
 
Posts: 52
Joined: Mon Jun 06, 2011 7:35 pm

Next

Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 5 guests