DS1307 RTC

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

siwo278
Posts: 39
Joined: Tue Feb 12, 2013 9:07 am
Has thanked: 4 times
Been thanked: 5 times
Contact:

Re: DS1307 RTC

Post by siwo278 »

Hello

My Modulus DS1307 RTC is OK, I tested it on a different platform (Arduino). I'll try to replace PIC16F877A PIC16F876A on it can make a difference. I have noticed one interesting. SDA line is a constant state of 0, and disconnecting it from the processor - the clock showed 0:00:00 00/00/00. Is it possible that the program has a different assignment FLOWCODE I2C communication processor PIC16F876A? (or I have a bad library of I2C communication) I can not even find repro in the program. LCD works, TMR0 is correct interpreted (DCF77 decoding), but communication via I2C. With I2C communication I also have another program using DS1820 on the same procesorze.Wiem that has already expired support for Flowcode 5 Maybe one of his experienced similar problems and share knowledge?

Witam

Mój modół RTC z DS1307 jest sprawny, przetestowałam go na innej platformie (arduino). Spróbuję zamienić PIC16F876A na PIC16F877A może to coś zmieni. Zaobserwowałam jedną ciekawostkę. Linia SDA ma ciągły stan 0, a rozłączając ją od procesora - zegar wskazywał wartości 00:00:00 00/00/00. Czy możliwe jest że program flowcode ma inne przypisania komunikacji I2C dla procesora PIC16F876A? (lub mam złą biblioteke z komunikacja I2C) Nie potrafie znaleść błedu w programie. LCD działa, TMR0 jest poprawny interpretowany (dekodowanie DCF77), tylko komunikacja przez I2C. Z komunikacja I2C mam też w innym programie, z wykorzystaniem DS1820 na tym samym procesorze.Wiem że już wygasło wsparcie dla Flowcode 5. Może któryś z kolegów doświadczył podobnych problemów i podzieli się wiedzą?
Attachments
rtctest.fcf
(86.21 KiB) Downloaded 816 times

siwo278
Posts: 39
Joined: Tue Feb 12, 2013 9:07 am
Has thanked: 4 times
Been thanked: 5 times
Contact:

Re: DS1307 RTC

Post by siwo278 »

Hello

After programming the PIC16F877A; the same thing happens. Faulty communication with the RTC. It's back to PIC16F876A. During testing I noticed some curiosity. When disconnecting the mass (GND) of the RTC module display (LCD) provides the correct reading of information. And this is no longer understands.

siwo278
Posts: 39
Joined: Tue Feb 12, 2013 9:07 am
Has thanked: 4 times
Been thanked: 5 times
Contact:

Re: DS1307 RTC

Post by siwo278 »

Hello!

After a very long break, back to the topic. I have a few questions to colleagues. I was able to run the system but in a strange configuration. In the drawings. The system is working properly when the resistors R3 and R4 are connected (Figure 1) When is disconnected (Fig. 2), the system operates incorrectly. What can cause this condition. I would add that the same real system behaves.

Witam

Po bardzo długiej przerwie, wracam do tematu. Mam kilka pytań do Kolegów. Udało mi się uruchomić układ ale w dziwnej konfiguracji. Na rysunkach. Układ pracuje poprawnie gdy rezystory R3 i R4 są podłączone (rys.1) Gdy zostaną odłaczone (rys. 2) układ pracuje błędnie. Jaka może być przyczyna tego stanu. Dodam że tak samo zachowuje się realny układ.
Attachments
rtc2.jpg
Figure 2
(473.76 KiB) Downloaded 14068 times
rtc1.jpg
Figure 1
(480.23 KiB) Downloaded 14068 times

siwo278
Posts: 39
Joined: Tue Feb 12, 2013 9:07 am
Has thanked: 4 times
Been thanked: 5 times
Contact:

Re: DS1307 RTC

Post by siwo278 »

Hi there!

Some fumbled on the Internet. I fell into such a thing to me, as a solution to the problem. Converter for I2C logic levels. Could this be the cause of problems in communication (voltage levels) between the DS1307 and the PIC16F876. According to the note sheet DS1307 should handle TTL standard. That something came to me in the simulation. Now let's see in the real system. I also found a few other solutions I2C communication with PIC systems, usually based on software solutions.

Cześć!

Troche poszperałam w internecie. I takie coś mi wpadło, jako rozwiązanie problemu. Konwerter poziomów logicznych dla I2C. Czy to może być przyczyną problemów w komunikacji (poziomy napięć) pomiędzy Ds1307 a Pic16F876A. Według noty katalogowej DS1307 powinien obsłużyć standard TTL. Takie coś mi wyszło w symulacji. Teraz sprawdzę w realnym układzie. Znalazłam też kilka innych rozwiązań komunikacji I2C z układami PIC, z reguły opierały się na rozwiązaniach programowych.
rtc3.jpg
rtc3.jpg (412.17 KiB) Viewed 23855 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: DS1307 RTC

Post by medelec35 »

Hi siwo278,
No,
Voltage converters are not required.
I have not got them on my hardware (pic 16F device), and RTC is working.
The issue I can see with your circuit is the resistors connected to SDA and SCL must be pull-up i.e go to +5V and not GND

Martin
Martin

siwo278
Posts: 39
Joined: Tue Feb 12, 2013 9:07 am
Has thanked: 4 times
Been thanked: 5 times
Contact:

Re: DS1307 RTC

Post by siwo278 »

Hello.

Yes I understand that pull up resistors are needed. This is required by the standard I2C. But in my particular case, and specific systems where only those resistors there is no communication between the DS1307 and the PIC16F876. When installing additional resistors to GND appeared communication (to my surprise - after all, it differs from the standard I2C). The program loaded into the PIC work (there was communication and properly interpret the data from the RTC). So why do not these resistors that are connected to GND does not have this communication. Program leaned on solutions on this board, so they are checked. So I do not know the PIC processor to write directly in the "C" in MATLAB. And only such a solution (with voltage conversion) made to measure their knowledge found. I know that this solution is a paradox because wsumie nothing should contribute immediately but in the simulation works. I checked it in the real system operates like but freezes the action processor. I went back to the additional resistor connected to GND. Owiele work better. I do not know what to do, and the code will not flovcode change anything because I do not even know what. Ultimately, the processor is clocked 6,1440Mhz, for the purpose of checking the progress of programming are treated 4MHz. By default I2C not change anything. What now?

Witam.

Tak rozumiem, że są potrzebne rezystory podciągające. Wymaga tego standard I2C. Ale w moim konkretnym przypadku i konkretnych układach jeżeli są tylko te rezystory nie ma komunikacji pomiędzy DS1307 i PIC16F876A. Montując dodatkowe rezystory do GND pojawiła się komunikacja (ku mojemu zdziwieniu - odbiega to przecież od standardu I2C). Program wgrany do PIC działa (pojawiła się komunikacja i odpowiednio interpretuje dane z RTC). Więc dlaczego bez tych rezystorów które są podłączone do GND nie ma tej komunikacji. Program oparłam na rozwiązaniach z tego forum, więc są sprawdzone. Aż tak się nie znam na procesorach PIC żeby pisać bezpośrednio w "C" w MATLAB. A tylko takie rozwiązanie (z konwersją napięć) na miare swojej wiedzy znalazłam. Wiem że to rozwiązanie jest paradoksem bo wsumie nic nie powinno wnieść ale w symulacji odrazu działa. Sprawdziłam to w realnym układzie niby działa ale powoduje zawieszanie działania procesora. Wróciłam do dodatkowych rezystorów podłączonych do GND. Działa owiele lepiej. Już nie wiem co zrobić, a w kodzie flovcode zmieniać nie będę niczego bo nawet nie wiem co. Docelowo procesor będzie taktowany 6,1440Mhz, dla potrzeb sprawdzania postępów w programowaniu taktuję 4Mhz. W ustawieniach domyślnych I2C nic nie zmieniam. Co teraz?
rtcbezdcfv1.fcf
(139.88 KiB) Downloaded 839 times

siwo278
Posts: 39
Joined: Tue Feb 12, 2013 9:07 am
Has thanked: 4 times
Been thanked: 5 times
Contact:

Re: DS1307 RTC

Post by siwo278 »

Welcome!

Well, nothing has been done with the PIC communication to the DS1307. I gave up already DS1307 services (damage) to the RTC72421, losing the entire 1 port PIC. The program in the PIC little changed, but moved from 1 time. And there are no problems with communication. For now, thank you all for your help and if someone comes up with an idea how to solve my problems with communication PIC and DS1307'll be grateful for any suggestions.

Natalia

Witam!

No i nic nie udało się zrobić z tą komunikacja PIC do DS1307. Zrezygnowałam już z usług DS1307 (szkoda) na rzecz RTC72421, tracąc przy tym cały 1 port PIC. Program w PIC troche się zmienił, ale ruszył od 1 razu. I nie ma już kłopotów z komunikacją. Na razie wszystkim dziękuję za pomoc i jeśli ktoś wpadnie na pomysł jak rozwiązać moje problemy z komunikacją PIC i DS1307 będę wdzięczna za wszelkie sugestie.

Natalia

Post Reply