Hi there,
Does anyone out there have PIC BASIC code to interface a PIC (I'm using the PIC16F877) to a PCF8583 real time clock IC?
Thanks!
Maria.
Hi there,
Does anyone out there have PIC BASIC code to interface a PIC (I'm using the PIC16F877) to a PCF8583 real time clock IC?
Thanks!
Maria.
Anyone can help me ?
I'm looking for 8583 routines to read and write data in i2c.
How can i increase minutes and then rewrite to 8583 ?
Thanks to all.....
The pins: sda and scl as inputs or outputs to microcontoller?
If As outputs:
sda=1 'high the portx.y, x is the port of micr.,y is the bit of portx.
scl=1 'high the same as previous
DECLARE HBUS_BITRATE 100 ' and other values
TRISC=%00000000 'as outputs
after you try with:hbstart,hbusout,hbstop (in pic basic functions)
if you have other problem you ask me.
regards
this will never work with Melabs. In case it's working... you should have a look on that forumDECLARE HBUS_BITRATE 100 ' and other values
TRISC=%00000000 'as outputs
after you try with:hbstart,hbusout,hbstop (in pic basic functions)![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi Maria, Lupuccio and PCF8583 users.
Code:
'************************************************* ***************
' Ime programa: RTC.BAS
' Opis: program ilustruje primenu sata realnog vremena PCF8583.
' Za povezivanje sa mikrokontrolerom se koristi I2CREAD
' naredba.
'************************************************* ***************
DEFINE LCD_DREG PORTD ' I/O port na kome se nalazi LCD
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTD
DEFINE LCD_RSBIT 2 ' Register select pin
DEFINE LCD_EREG PORTD
DEFINE LCD_EBIT 3 ' Enable pin
DEFINE LCD_BITS 4 ' 4-bitni data bus
DEFINE LCD_LINES 2 ' LCD ima dva reda karaktera
symbol SCL = PORTC.3 ' I2C data pin
symbol SDA = PORTC.5 ' I2C clock pin
Sec var bit
B0 var byte
S var byte ' Sekunde
M var byte ' Minuti
H var byte ' Sati
D var byte ' Dan
Mn var byte ' Mesec
Y var byte ' Godina
OPTION_REG = $7f ' Omoguci PORTB pullup otpornike
lcdout $fe,1 ' Obrisi ekran displeja
Main:
I2CREAD SDA,SCL,%10100001,2,[S]
I2CREAD SDA,SCL,%10100001,3,[M]
I2CREAD SDA,SCL,%10100001,4,[H]
I2CREAD SDA,SCL,%10100001,5,[D]
I2CREAD SDA,SCL,%10100001,6,[Mn]
I2CREAD SDA,SCL,%10100001,6,[Y]
lcdout $fe,1 ' Obrisi displej
lcdout $fe,2 ' Prvi red prvi karakter
lcdout "Time: ", hex(H),":", hex(M)," ", hex(S)
lcdout $fe,$c0 ' Drugi red, prvi karakter
lcdout "Date: ", hex(D),".", hex(Mn),".20",hex(Y)
Pause 500
goto Main ' Ponovi sve
End ' Kraj programa
Thanks to all for the answers.....
The only problem that i have... ( a big problem ) is set hour and minutes with buttons.
Unfortunely i haven't the code here.
Next week i will post my code.
and then i hope that someone can help me.
Thanks again to all.
I'm trying to make a propeller clock with 22 LEDs and was wondering if I can help with handcuffs programming ...... in part to pass the information that the PCF8583 fornesi my PIC (16F877) and passes it to the LEDs ... was shackled to help me say something ... thanks
ps.: I'm working with miKroC
Last edited by EAST___; - 14th April 2010 at 10:49.
Hi, East
You could find much better help on the ... MikroC Forum.
Here: http://www.mikroe.com/forum/viewforum.php?f=13
Don't you think ???
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Dear EAST
a "propeller clock with 22 LEDs" is a diferent project.
It´s not similar than LCD clock, like my code was describe.
I am sorry, but it's very dferent.
Bookmarks