View previous topic :: View next topic |
Author |
Message |
fernandoagf
Joined: 16 Oct 2007 Posts: 2
|
Showing date and time of a DS1302 RTC into a LM016 LCD |
Posted: Tue Oct 16, 2007 7:54 pm |
|
|
Hello everybody,
I'm just starting programming PICs and I made some small programs, play putiing ports at high and low states, displayed some characteres on a LM016 display.
Now I want to use a DS1302 RTC to tell me the date and time and display it on a LCD display (LM016). I'm using a PIC 16F877a.
I tried a few times but I couldn't get it to work. Could anybody show me how to do that?
Thanks for the help in advance,
Fernando. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Oct 16, 2007 8:06 pm |
|
|
See this CCS example file:
Quote: | c:\Program Files\PICC\Examples\Ex_rtclk.c |
|
|
|
fernandoagf
Joined: 16 Oct 2007 Posts: 2
|
|
Posted: Tue Oct 16, 2007 8:32 pm |
|
|
Thank you man. It really helped a lot. Now I have one question? In order to put the keyboard to work, do I have to put any resistor between the keyboard and the PIC? Would it be some pull-up resistor? What would be their values?
nother question: The KBD.C driver and the ds1302.c driver are using the same port (B) so I changed the port for the RTC. So now I have the conectors of the DS1302 connected to the pic as follows:
RST on port C2
CLK on port C1
IO on port C3
So I changed the ports on ds1302.c Is it ok? Can I use these pins? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Oct 16, 2007 9:02 pm |
|
|
The keypad needs pull-up resistors on the Row pins. You can use
4.7K or 10K ohm resistors.
Yes, you can use those other pins for the DS1302. |
|
|
|