What is the question chai98a?
-----------------
What is the question chai98a?
-----------------
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
About code is work no problem we post for share idea for other peple.
"Code Example " is forums for place with sample code with working right...
Hello chai98a
Thank you for your code. I am also trying the same stuff with some 10 voice alarms at this end. I have 3 buttons to spare to enter the alarm.
I am looking for some Idea to SET the RTC clock time with just three buttons and 4 digit display.
Any help.
Let you show circuit daigram..and some detail of 3 bottom function.
I never try about this
Hello Chai98a,
Ok, here's the schematic. I have just 3 buttons to set the RTC time.
That is not the problem but the problem is the way to set the RTC with a 4 digit - 7 Segment display.
The display type is 74HC595 connected to each of the digit.
regards
Dear Charu,
It is important to know how you have hooked up your 74HC595 to your displays. With the OE (Pin 13) tied to ground and the RESET(Pin 10) tied to the VDD. You should be dealing with at least 3 pins , Shift_Clock (Pin 11), Serial Data In (Pin 14) and Latch (Pin 12) hooked to your PIC. If you have multiple digits each driven by a 74HC595 then Pin9 from the first one goes to PIN 14 of the second and so on. Thus you share the Clock and the Latch of all thems in common. Normally you would hookup the Q0to Q7 outputs of the shift register to the seven segment --> dp,G,F,E,D,C,B,A . This is so because the bit you stuff in first goes to the last (shifted as supposed to be)
Now for some code examples:
Lets assume S_CLK is an alias for the clock line, S_DAT is an alias for the Serial Data line and S_LAT is an alias for the Latch Line.
Also let the characters to load for each display is DISP1, DISP2, and so on.
Please note that you would need a lookup table to convert binary values into proper segment data before dumping.
This could be done in modular way using FOR-NEXT loop. But if you are using an array for your display data then PBP does not support modifiers likeCode:S_DAT= 0 : S_CLK= 0 : S_LAT= 0 ' MAKE SURE THE CONTROL LINES ARE LOW S_DAT = DISP4.0 : S_CLK=1:S_CLK = 0 ' PUSH THE FIRST BIT S_DAT = DISP4.1 : S_CLK=1:S_CLK = 0 ' PUSH NEXT S_DAT = DISP4.1 : S_CLK=1:S_CLK = 0 ' PUSH NEXT " " " " ' REPEAT FOR OTHER DISPLAY DATA AS WELL S_LAT = 1 : S_DAT = 0 : S_LAT = 0 ' LATCH THE DATA ON THE 595
S_DAT = DISP[0].I
But it can be done by dumping it to a temporary variable.
Hope this helps.
I have used 595s in moving display app and cascades 24 of them. PCB layout and some sort of slew rate control, shared line drive and termination may be necessary if it is a long chain. For such app consider using STP16C596.
Regards
Sougata
Hello Sougata,
I have got the code up and working for the HC595 and is working good. The clock is up and running and I can enter the alarm timing and trigger segment perfectly, so the problem is not the code help in driving the HC595 but some logic help in setting the clock with 3 pins and 4 digits for Hours and Mins.
I would be working on setting two digits at a time which would be for Hours and Mins, Blank the other two digits so that it does not confuse. 1 switch to shift between Hours , mins , Ack change and come out of the setting mode and the other two switches simply to incr , decr the values of Hours and Mins.
Just wondering if there was any other way of setting the clock with three buttons and 4 digits.
regards
Bookmarks