DS1307 F7.3

A forums to allow bugs and problems with Flowcode v7 to be reported and resolved.

Moderator: Benj

Post Reply
claudemir
Posts: 55
Joined: Sat Nov 03, 2012 7:43 am
Contact:

DS1307 F7.3

Post 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?

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Contact:

Re: DS1307 F7.3

Post 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 213 times
1 in 10 people understand binary, the other one doesn't !

claudemir
Posts: 55
Joined: Sat Nov 03, 2012 7:43 am
Contact:

Re: DS1307 F7.3

Post 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
Attachments
Comunicacao_V7_Iluminacao.fcfx
(945.93 KiB) Downloaded 107 times

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Contact:

Re: DS1307 F7.3

Post 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
1 in 10 people understand binary, the other one doesn't !

claudemir
Posts: 55
Joined: Sat Nov 03, 2012 7:43 am
Contact:

Re: DS1307 F7.3

Post 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.

claudemir
Posts: 55
Joined: Sat Nov 03, 2012 7:43 am
Contact:

Re: DS1307 F7.3

Post 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.
Attachments
SimpleClock.fcfx
(10.79 KiB) Downloaded 107 times

claudemir
Posts: 55
Joined: Sat Nov 03, 2012 7:43 am
Contact:

Re: DS1307 F7.3

Post by claudemir »

Can someone help me solve my problem? :roll: :roll:

mnf
Valued Contributor
Valued Contributor
Posts: 793
Joined: Wed May 31, 2017 11:57 am
Contact:

Re: DS1307 F7.3

Post 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 130 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

claudemir
Posts: 55
Joined: Sat Nov 03, 2012 7:43 am
Contact:

Re: DS1307 F7.3

Post 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

mnf
Valued Contributor
Valued Contributor
Posts: 793
Joined: Wed May 31, 2017 11:57 am
Contact:

Re: DS1307 F7.3

Post 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

claudemir
Posts: 55
Joined: Sat Nov 03, 2012 7:43 am
Contact:

Re: DS1307 F7.3

Post 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.
Attachments
UNO whit RTC disabled.fcfx
(11.02 KiB) Downloaded 70 times
UNO whit RTC active.fcfx
(10.97 KiB) Downloaded 81 times
migrate to the mega 2560.fcfx
(986.3 KiB) Downloaded 68 times

mnf
Valued Contributor
Valued Contributor
Posts: 793
Joined: Wed May 31, 2017 11:57 am
Contact:

Re: DS1307 F7.3

Post 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
Last edited by mnf on Sat Feb 24, 2018 10:14 am, edited 1 time in total.

mnf
Valued Contributor
Valued Contributor
Posts: 793
Joined: Wed May 31, 2017 11:57 am
Contact:

Re: DS1307 F7.3

Post 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

claudemir
Posts: 55
Joined: Sat Nov 03, 2012 7:43 am
Contact:

Re: DS1307 F7.3

Post 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.

mnf
Valued Contributor
Valued Contributor
Posts: 793
Joined: Wed May 31, 2017 11:57 am
Contact:

Re: DS1307 F7.3

Post 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

claudemir
Posts: 55
Joined: Sat Nov 03, 2012 7:43 am
Contact:

Re: DS1307 F7.3

Post 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

mnf
Valued Contributor
Valued Contributor
Posts: 793
Joined: Wed May 31, 2017 11:57 am
Contact:

Re: DS1307 F7.3

Post by mnf »

Glad to hear all is working again..

Good luck with project!

Martin

claudemir
Posts: 55
Joined: Sat Nov 03, 2012 7:43 am
Contact:

Re: DS1307 F7.3

Post 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?

User avatar
Benj
Matrix Staff
Posts: 14865
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: DS1307 F7.3

Post 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.

claudemir
Posts: 55
Joined: Sat Nov 03, 2012 7:43 am
Contact:

Re: DS1307 F7.3

Post 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
Attachments
ds1307 RTC.JPG
ds1307 RTC.JPG (44.77 KiB) Viewed 4137 times

User avatar
Benj
Matrix Staff
Posts: 14865
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: DS1307 F7.3

Post 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.

claudemir
Posts: 55
Joined: Sat Nov 03, 2012 7:43 am
Contact:

Re: DS1307 F7.3

Post 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.

Post Reply