My RTC is ds1307 not work

Status
Not open for further replies.
Actually, RB6/PGC and RB7/PGD can be used as both ICSP for device programming and Digital I/O during runtime, however you cannot use the debugging feature if RB6/PGC and RB7/PGD are used as Digital I/O and it must be disabled by properly configuring the Configuration Register bits.

One of the more straight forward methods of implementing buttons is to use either the External Interrupt of RB0 or Interrupt On Change feature of RB4:RB7. Using this technique allows a button closure to trigger an interrupt service routine (ISR) which can handle the appropriate action depending on which button was pressed/closed.

Reference: PIC16F87XA Datasheet , Section: 4.2 PORTB and the TRISB Register, Page: 44


BigDog
 

Re: My RTC is ds1307 not work (C problem)

....
If you need inspiration for composing an I2C library of routines, you may want to reference the Hi-Tech routines for the PIC18.
....
Attached is the I2C Library Source Code and Header File.
....

@ bigdogguru
Thanky you for the published I2C library.

@ C gurus

In many cases, a mixture of signed and unsigned chars can be seen in the published routines (such as the "unsigned char getsI2C" function returns with -1 !). I do not know the Hi-Tech C, but this difference does not cause translation errors? Of course I also know that the signed char -1 is equal to the unsigned char 255, but the C compilers are generally sensitive to this difference.

Regards
zuisti
 

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…