Page 1 of 1

DS1307 F7.3

Posted: Sun Jan 28, 2018 12:30 pm
by claudemir
Hello, I do not know if there is already a topic on this fact, but if you have not found it.
My problem is related to DS1307 version F7.3, in the simulation does not run and in version F7.2 it works normally, it stopped working after the upgrade from version F7.2 to F7.3 has anyone had a solution for this?

Re: DS1307 F7.3

Posted: Sun Jan 28, 2018 2:36 pm
by JohnCrow
Hi Claude

I've just tried a simple flowchart for the DS1307 under V7.3 and it seems to work here.
SimpleClock_V1.fcfx
(10.61 KiB) Downloaded 618 times

Re: DS1307 F7.3

Posted: Wed Jan 31, 2018 10:07 pm
by claudemir
Hi JohnCrow
I tried here still not working,
but my project is a bit different.
I've attached it to see if you can run it

Re: DS1307 F7.3

Posted: Tue Feb 06, 2018 8:16 am
by JohnCrow
Hi
Sorry only just spotted your post, not getting much time on the forums or on flowcode at the moment. Will give it a try for you

Re: DS1307 F7.3

Posted: Fri Feb 16, 2018 11:39 pm
by claudemir
Hello John
The rtc simple clock file you sent has how to simulate with computadoe hours reading? because for me he writes zero for the hour and minute.
Thank you.

Re: DS1307 F7.3

Posted: Tue Feb 20, 2018 1:39 am
by claudemir
Hello
I need a help from you, I have a watch project with DS1307 that is running perfectly on a pic 18f4560, due to the lack of space I had to migrate to the mega arduino 2560.
Where is the big problem, when I download the project for the hardware, the outputs and digital inputs stop working, in the simulation everything works perfect, only in the hardware that was not, I was examining the defect and got in the line of RTC_clock, I removed all that line and the digital inputs and outputs came back online, inserted the RTC_clock line again and stopped working.
Please see where this error may be.

Re: DS1307 F7.3

Posted: Wed Feb 21, 2018 12:26 am
by claudemir
Can someone help me solve my problem? :roll: :roll:

Re: DS1307 F7.3

Posted: Wed Feb 21, 2018 8:37 am
by mnf
Hi Claude,

I just tried your code and the DS1307 seems to work AOK on a Uno. I modded the code slightly to output the time to UART (and disabled the 'set time' macros - the clock attached was set):

Can you try the following?
SimpleClock.fcfx
(11.39 KiB) Downloaded 364 times
and see what output you get on the serial port...

There was a problem with the RTC clock component - it needed a i2c restart in the read commands - however if you are using FC 7.3 it is fixed. (See http://www.matrixtsl.com/mmforums/viewt ... 64&t=19065

You could take a look at the C generated (or post some here)

Martin

Re: DS1307 F7.3

Posted: Wed Feb 21, 2018 11:33 pm
by claudemir
Hi martin
My problem is when I use digital outputs and inputs where I am using the RTC, the outputs are even forced to high, they go low, there is some interference between the outputs and the RTC.
When I remove the RTC the outputs return to high, even with the UNO. I have tested with the RTC, I2C Master, DS1703, all forced outputs to low, and in the software are forced to high

Re: DS1307 F7.3

Posted: Thu Feb 22, 2018 8:44 am
by mnf
Hi Claude,

What's your hardware setup?
The Arduino mega uses different pins (to the Uno) for i2c and they do need pull up resistors (though note that most clock break out boards include them). The AVR chips have built-in pull-ups but they don't seem to be enabled by default in the FC libraries.

Can you get the clock to work at all, and something in your digital output code is breaking things or nothing working at all- which maybe suggests a hardware fault?

How and what digital output are you trying to do?

Martin

Re: DS1307 F7.3

Posted: Fri Feb 23, 2018 2:25 am
by claudemir
Hi martin
My hardware I am using is the mega 2560, the software worked on the pic 18f4620 but due to the size of the eepron I had to migrate to the mega 2560, I tested it on the other mega that I have here but nothing works, the simulation works fine.
I created a new project with the arduino UNO, I added the RTC1307 and two outputs and set them to high (pin D2, D3 = 1 output = 5v), but it does not go to high (D2 D3 = 1,2v), when I removed the RTC1307, the outputs D2 and D3 goes to high (5v).
In the annex I send the software of the mega 2560 and also of the UNO in which I am having the same problem.
In DS1307 I am already using the pull up resistors, the clock works perfectly, but the outputs do not work when I use the clock.

Re: DS1307 F7.3

Posted: Fri Feb 23, 2018 8:07 am
by mnf
& how is the RTC connected ? Breakout board ? Shield ?

The Arduino can easily supply enough power to run the chip and other outputs (see my ZERO tower clock- where a RTC chip is run from two pins and a 4 x LED 8x8 matrix run from another two pins - viewtopic.php?f=66&t=19356&start=25 )

If the DS1307 sinks enough power to stop other pins being pulled high then I think the magic white smoke may be released?

Martin

Re: DS1307 F7.3

Posted: Fri Feb 23, 2018 8:25 am
by mnf
I've just tested the Uno with RTC and seems to work fine - lovely 5V signal on the scope on D3.

Have to go to work now - but what else do you have connected to the board - what are the output pins sinking to?

RTC seems to be set to DS3231 - although should still work. Try 100khz instead of 400khz (though works). I'm not sure how to use the remap pins - but they don't seem to affect anything (here)...


Had a quick look at the Mega2560 code - wow - I have an Arduino Mega around and 'most' of the hardware (I don't have the same LCD display) - but let's get the RTC working in isolation first!! (Though I've been struggling to get bluetooth to work (despite earlier success) - so you might be able to reciprocate with some tips on that!)

Martin

Re: DS1307 F7.3

Posted: Sat Feb 24, 2018 12:19 am
by claudemir
HELLO
I made a short video for you to understand what is happening, but it is great to send to the forum topic, maybe by email

I'm really not understanding what's going on, I imagine it might be up to the licensed flowcode
thank you.

Re: DS1307 F7.3

Posted: Sat Feb 24, 2018 7:21 am
by mnf
Hi,

Please post the video or link to it. I don't think this is related to your Flowcode license. What happens if you just connect the DS1307 chip but don't access it- just try setting pins D2/d3 high (don't even initialise the clock component). Do you get the same result? I notice that in the mega code you are not using the component (at least you seem to have copied/rewritten most of the macros).
Do you have access to the Arduino IDE? Can you try the RTC example programs?
Martin

Re: DS1307 F7.3

Posted: Sun Feb 25, 2018 3:05 am
by claudemir
Hello
I was happy, I killed what was killing me, I found what was blocking the digital outputs, I simply uninstalled the flowcode and installed again, it seems to be working now, I changed the clock from 100kHz to 400kHz RTC works normally, I believe you had a problem in installation of flowcode, things that I never imagined happened before, but it is not something that happens to a layman like me.

For now I only have to thank for taking my doubts

Re: DS1307 F7.3

Posted: Sun Feb 25, 2018 9:02 pm
by mnf
Glad to hear all is working again..

Good luck with project!

Martin

Re: DS1307 F7.3

Posted: Fri Jun 15, 2018 4:06 am
by claudemir
Ola
Fiz varios prototicos usando RCT ds 1307, apos longo periodo comecei a receber reclamaçoes que os minutos dentro de um mes adianta 5 minutos, li num post do Benj onde corrigiu um problema parecido alterando a frequencia de 16 mhz para 15,88 mhz no componente flowcode , porem não encontro esse post e tambem não lembro qual componete é onde altera a frequencia do oscilador, sei que não é comum fazer isso, mas alguem pode ajudar?

Re: DS1307 F7.3

Posted: Fri Jun 15, 2018 5:50 pm
by Benj
Olá,

O ajuste do relógio nas opções do projeto é uma falha crítica para tentar ajustar os tempos de 1 fio para obter comunicações.

Se você está se comunicando com sucesso com o módulo RTC de 1 fio, então a configuração do relógio provavelmente interromperá as comunicações e não afetará as leituras de tempo do RTC. Talvez procure as especificações do dispositivo 1-Wire e veja se você talvez precise fazer algo com isso, por exemplo adicione um capacitor de desacoplamento.



Hello,

The clock adjustment in the project options is a botch to try and tweak the 1-wire timings to achieve communications.

If you are successfully communicating with the 1-Wire RTC module then tweaking the clock setting is likely to break communications and will not effect the RTC time readings. Maybe look up the specifications for the 1-Wire device and see if you maybe need to do something with this, e.g. add a decoupling capacitor.

Re: DS1307 F7.3

Posted: Sat Jun 16, 2018 4:14 am
by claudemir
Hello benj
Thanks for the feedback, I already use a capacitor of 0.01μF, but it did not help.
I use this template in the attachment

Re: DS1307 F7.3

Posted: Mon Jun 18, 2018 1:03 pm
by Benj
This is from the DS1307 datasheet.
CLOCK ACCURACY
The accuracy of the clock is dependent upon the accuracy of the crystal and the accuracy of the match
between the capacitive load of the oscillator circuit and the capacitive load for which the crystal was
trimmed. Additional error will be added by crystal frequency drift caused by temperature shifts. External
circuit noise coupled into the oscillator circuit may result in the clock running fast. See Application Note
58, “Crystal Considerations with Dallas Real-Time Clocks” for detailed information.

Re: DS1307 F7.3

Posted: Tue Jun 19, 2018 3:38 am
by claudemir
Hello
I was reading better on ds1307 and ds 3231, actually the ds1307 can generate 5 minute shift per month, while the 3231 ds around 7 minutes a year, I will change the ds to see if I leave the clock more accurate.