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.

Need code for interfacing PCF8583 and 8051

Status
Not open for further replies.

vamanan

Full Member level 2
Joined
Aug 9, 2005
Messages
135
Helped
10
Reputation
20
Reaction score
4
Trophy points
1,298
Location
India the Great
Activity points
2,286
cAN ANYBODY GIVE CODE TO INTERFACE 8051 WITH PCF8583
ALSO PLEASE TELL ME WHETHER THERE IA ANY NEED FOR CAPACITOR AT THE CRYSTAL OSCILLATOR AT OSCIN AND OSCOUT PIN OF PCF8583?
THANKING YOU.
 

pcf8583 year

you may find at
**broken link removed**

good luck.
 

pcf8583 asm

Friend ,
I am unable to get any code in that page.
Can anybody help me with some assembly codes?
 

pcf8583 code

you may use this reference

**broken link removed**

regard and good luck.
 

pcf8583 8051

Try this application note:
**broken link removed**
It describes I2C routines and among examples you wll find code (in assembly) on reading time from PCF8583 ..
Regards,
IanP
 

pcf8583 batterie

Dear friends,
I got another doubt during the development.How to store the value of year in PCF8583?.
Is it possible to store the year like 2005 ?.Also how it will identify a leap year?.
Thanking you.
 

pcf8583

The year in short format is alread stored in the PCF8583. Additioal "20" you can store enywhere within the availablePCF's RAM or as a constant defined in the 8051. After all it is 2005 so before changing anyting we still have 95 years to go ..
As far as the leap year is concerned you will have to program 8051 to address this issue.
Here is an example of a code for setting a bit LeapYear:
Leap_Year: PUSH DPL
PUSH DPH
PUSH ACC
PUSH PSW
MOV DPTR, #Leap_Table
MOV B, #00h

Leap_Loop: MOV A, B
MOVC A, @A+DPTR
CJNE A, #0FFh, Leap_Comp
LJMP Leap_Clear
Leap_Comp: CJNE A, Year, Not_Leap
SETB LeapYear
LJMP Leap_Exit

Not_Leap: INC B
LJMP Leap_Loop

Leap_Clear: CLR LeapYear

Leap_Exit: POP PSW
POP ACC
POP DPH
POP DPL
RET

Leap_Table: DB 00h, 04h, 08h, 12h, 16h, 20h, 24h, 28h, 32h, 36h, 40h, 44h, 48h
DB 52h, 56h, 60h, 64h, 68h, 72h, 76h, 80h, 84h, 88h, 92h, 96h, 0FFh

Regards,
IanP
 

please help with alarm in pcf8583

IanP,
In PCF8583 there are only 2 bits (MSB) at memory location 05H.So if I am correct we can store only three values for a year (0 to 3).I didnt understand how we can arrive at the full year format like 2005 just by storing an additional 20 at any free RAM Location.Can you please help me in this matter.However I understood how to tackle the leap year problem just by going through your code.
Thanking You.
 

pcf8583 asm programme

up to my knowledge there is 1 byte for an year.... please check once again.

The address of years register is 0x08 not 0x05... please check once again

remember all values are in bcd, you need to convert to/from binary.

If you want a sample C source is available.

you can 2000 in code and store 05 in year register.

Cheers
 

pcf8583 sample code

The year location (at 08h) has, as you said, 2 bits (see attached drawing).
Because this IC should have also battery back-up you can store the year (20d and 05d) values in the IC's memory and increase this value with any change in the year bits.
Other option is to have the year as two-byte constant in your code or definitions and then to add the value of year's 2 bits to the 05d each time the month alarm bit is set. By doing this you will be covered for the next 3 years, till 2008 that is ..
Regards,
IanP
 

pcf8583 application note

Sorry,

I am confused. I reffered to 8563 chip which I have used.

You can try with the solution suggested by IanP

Cheers
 

pcf8583 assembler

I tried IanP's solution.It is working without any problem.
Thanx.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top