Jump to content
ELFORUM - Forumul electronistilor

16f628+ds1307+lcd - problema

Recommended Posts

Salut, am conectat pic-ul cu ds1307, am scris codul :


CMCON=0x07; // disable comparators


TRISA = 0b01100001;

TRISB = 0b00000001;






Soft_I2C_Config(&PORTA, 0, 7); // Initialize full master mode

Soft_I2C_Start(); // Issue start signal

Soft_I2C_Write(0xD0); // Address DS1307

Soft_I2C_Write(0); // Start from word at address 0

Soft_I2C_Write(0x80); // Write 0x80 (stop counter and zero seconds)

Soft_I2C_Write(0x30); // Write 30 to min

Soft_I2C_Write(0x20); // Write 20 to hrs

Soft_I2C_Write(1); // Write 1 - day of week

Soft_I2C_Write(2); // Write to day of month

Soft_I2C_Write(6); // Write 6 to month

Soft_I2C_Write(9); // Write 9 to year

Soft_I2C_Write(0x10); // SQWE output at 1 Hz

Soft_I2C_Stop(); // Issue stop signal


si nu imi da semnal pe sqw si pe lcd apare ???? .SCL si SDA au fost pull-up cu 10k si acum sunt cu 4,8k, bateria la ds1307 este conectata dar tot nu palpaie led-ul de pe sqw. Vreo solutie ?

Link to comment
  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.Terms of Use si Guidelines