Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

help on speaking clock project (PIC)

Status
Not open for further replies.

desley

Newbie level 4
Joined
Oct 25, 2005
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,364
project pic

hi all,

I'm trying to do this project: speaking clock using pic16f84, ds1302 & isd2590
I have an example of a quite similar project, as enclosed.

can anyone help me to modify the program so that i dont have to use dcf77 to set the time?
any help will be much appreciated.
 

isd2590 +pic

The dcf77 is used for getting the correct time. You will have to modify the code of routine RealTime. You can use some dip switches to set the time of your clock.
 

    desley

    Points: 2
    Helpful Answer Positive Rating
pic clock routine

thnx for replying.. but i am still confuse on how to set the time using dip switches. can i still use pic16f84 or i have to use other pic with more pins? i will appreciate if u can give me an example. thnx
 

dcf77 pic16f84

anyone else can help me on how to modify the Realtime routine? pls i'm running out of time
 

dcf pic clock

If you disconnect and eliminate the DCF-77 block you will free 2 of PIC's pins ..
There are several possible scenarios, but my favorite is to connect a PS/2 keyboard ..
All what you need is to feed small 5V @<50mA power to keyboard, GND and 2 signal lines: CLOCK and DATA, and that is exactly what you have available - 2 PIC's pins ..
Here is an example of code on PIC<-->PS/2 keybord ( https://www.trash.net/~luethi/microchip/projects/keyboard/v1xx/keyboard_v1xx.html )
After the keyboard routine is implemented you can remove the whole RealTime sub from the taling clock code ..

Regards,
IanP
 

    desley

    Points: 2
    Helpful Answer Positive Rating
pic dcf77

thanx for ur info IanP. I'm still trying to understand the method. can anyone explain more about setting the time using dip switches? so that i can compare which method is easier. thnx in advance
 

dcf pic

Hey can you tell how much you know about pic programming. Are you beginner or have done some simpler projects?
 

horloge+pic+dcf77

i am a beginner :D
 

dcf clock

Well, what you are trying to do is not really trivial, at least not if you want to include a way to really set the time. The way I would go at it is to change the subroutine RealTime. This is what reads the time from the dcf77, into vars, which will be used to update your real time clock. Instead of reading the dcf77, you want to read some pushbuttons to update the time.
What you want to do is load the variables minute and hour from a user interface, rather than the dcf77.
The first step should be to display the current time. You could then write a sub to increment each of hour, minute, and seconds, each one checking to make sure you haven't gone too far. For example if minutes => 60, then inc hour by one, and set minutes to 0. You need at least two pushbuttons, one for increment, and one for accept. You read the buttons, and decide what to do, depending on which one is pushed. When you have a routine to do all the increments, then you have to create one to decrement, if you want to have a nice interface. You will also need another push button. These routines will be the challenging part. (At one time I had some assembly to do this, but that was so long ago, and I'm not sure what I did with it, otherwise I'd have included it.)
You will need to de-bounce the buttons before you read them. When the user pushes increment, you want to update the display to show this. When your user pushes the accept button, you then write that value back to the appropriate variable. You can then call the routine SetTime to update your real time clock.
As IanP says, you will free up a couple of pins on your micro, which you would be able to use to read switches. I know you won't have enough pins to read four switches, though, so you may have to go with another method. You could use four (or even up to ten) switches to read a series of resistors and input an analog value, which would only take one pin. Look up AD switches to get more info on this.
I hope you can follow this, and it is helpful. If you have any questions, just ask.
Best wishes,
Robert
 

    desley

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top