RTC DS12887A and PIC16F877A! need help please...

Status
Not open for further replies.

cutemint

Newbie level 4
Joined
Feb 23, 2009
Messages
5
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,312
Can anyone give me a circuit and a simple program (MikroC) for reading the time and date of the RTC? i think im having troubles, i seem cant to get the right output. First of all, IDK how RTC works (noob). Please and Thank You...
 

I don’t think many PIC-users are keen to employ the DS12887 ..
This IC (and all others from the same family) have implemented multiplexed address/data bus and ideal to work with 80-xxx series, eg. 8051-derivatives ..

But, with microcontroller almost anything is possible ..
Try to follow the attached procedure and see how it goes:

IanP
:wink:
 
Reactions: DrWhoF

    DrWhoF

    Points: 2
    Helpful Answer Positive Rating
i found another simple guide https://www.edaboard.com/threads/66517/ , but there seems to be something wrong. i converted his code to mikroC, and the result was a constant output. heres the code i made:

void main()
{
int i;

TRISB=0x00;

for(i=0;i<5;i++)
{
PORTB=0x00;
delay_ms(500);
PORTB=0xFF;
delay_ms(500);
}

PORTB=0x00;

while(1)
{
TRISC=0x00;
PORTC=0x00;
PORTD.F7=0;
TRISC=0xFF;
PORTD.F6=0;
PORTB=PORTC;
PORTD.F6=1;
PORTD.F7=1;
}

for(i=0;i<256;i++)
{
PORTB=i;
delay_ms(200);
}

}

the pinouts are:
AD0-7 --- PORTC
AS --- PORTD.F7
DS --- PORTD.F6

my aim was to display in portb whatever the seconds output in the DS12887A.
the problem was it only display a constant output of 01011110 in the LEDs.

Please help
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…