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.

[PIC] Spurious SCl transition detected in proteus: RTC DS1307 and PIC 18F4520

Status
Not open for further replies.
Already checked with this..
In that case, my Proteus simulation is continuously running and hangs after some time.
 

Generate cof file and use it for Proteus and debug. If you want to display time then you should read atleast once every while(1) loop. I don't know whether DS1307 Proteus model has inbuilt 32.768 KHz clock or not. Your crystal used for RTC is set to 1MHz.
 

The same problem persists..
rtc resets after every 2 seconds.
 

Resetting if last while(1); loop is present.
Hanging if that loop is removed.

Also, I disabled the WDT in code.
In that case my timer interval window works perfectly fine in Proteus. But I2C debugger window is not showing any data.
How should I disable WDT in proteus?
 

DS1307 clock window has nothing to do with your code. It runs on its own and gets time from PC clock. There is a check box to syncronize RTC time with PC. Uncheck it and see.

Zip and post latest code (all files of the project). I just can't create a new project!
 

Thank you Jayant for your co-operation.
PFA for complete solution.
 

Attachments

  • I2C.rar
    27.3 KB · Views: 53

@Jayant:

Hex file from my micro c project works perfectly in the same Proteus simulation.
 

Yes Jayant..
But I2C debugger is not showing any data in proteus.
It is not working on hardware too.
 

Maybe you need to set registers related to oscillator properly in PIC18F devices. In mikroC it does all those things but in C18 you have to set it.


Code fixed. Try to print rtc values to usart. Better use 10 MHz so that spbrg value for uart can be used from datasheet.


Edit: Your Time transformation routine is wrong for DD:MM:YY
 

Attachments

  • New folder.rar
    44.5 KB · Views: 60
  • RTC DS1307 LCD PIC18F4520 20 MHz.rar
    35.1 KB · Views: 59
Last edited:
Thanx buddy..
Thank you very much..
It works perfectly fine.
 

@Jayant
Sorry to disturb you again buddy..
Your MPLAB project works perfect but when I try to open your project in my mplab IDE it is not working.
So, I converted your project as per my MPLAB IDE version compatibility.
But IdleI2C(); function is not working there it shows error..

Thanx in advance.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top