Sensor DS18B20

Any bugs you encounter with Flowcode should be discussed here.
chipfryer27
Valued Contributor
Posts: 1528
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 353 times
Been thanked: 549 times

Re: Sensor DS18B20

Post by chipfryer27 »

Hi

Not got access to FC just now to see your chart and I'm unsure how you are multiplexing but perhaps when in the macro that is adjusting the digit you could pulse the common pin?

Maybe something along the lines of using "x" as the variable to control the output pin, being 0 or 1.

Set an interrupt on a timer say for 600mS (or whatever) enabled when in the required macro, disabled when leaving. In the ISR have a calculation.

x = ! x (x = not x, changing between values every 600mS)

In your multiplex, check the value of x when it comes time to refresh the digit of interest and if 0 don't refresh.

Just a thought and without access to the chart I'm unsure how practical it may be.

Regards

Carmelo
Posts: 121
Joined: Thu Oct 14, 2021 10:04 am
Has thanked: 49 times
Been thanked: 4 times

Re: Sensor DS18B20

Post by Carmelo »

chipfryer27 wrote:
Sat Mar 22, 2025 5:24 pm
Hi

Not got access to FC just now to see your chart and I'm unsure how you are multiplexing but perhaps when in the macro that is adjusting the digit you could pulse the common pin?

Maybe something along the lines of using "x" as the variable to control the output pin, being 0 or 1.

Set an interrupt on a timer say for 600mS (or whatever) enabled when in the required macro, disabled when leaving. In the ISR have a calculation.

x = ! x (x = not x, changing between values every 600mS)

In your multiplex, check the value of x when it comes time to refresh the digit of interest and if 0 don't refresh.

Just a thought and without access to the chart I'm unsure how practical it may be.

Regards
Gracias por la respuesta, me ha servido de mucho.
He implementado unas condiciones dentro de la rutina de multiplexado que se cumplen cada cierto tiempo dado por el TMR1.
En concreto han sido 3 una para las centenas, otra para las decenas y otra para las unidades.
Ahora todo funciona bien.

C.

chipfryer27
Valued Contributor
Posts: 1528
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 353 times
Been thanked: 549 times

Re: Sensor DS18B20

Post by chipfryer27 »

Hi

Glad it is working and happy to have been of some help.

Regards

Carmelo
Posts: 121
Joined: Thu Oct 14, 2021 10:04 am
Has thanked: 49 times
Been thanked: 4 times

Re: Sensor DS18B20

Post by Carmelo »

chipfryer27 wrote:
Sun Mar 23, 2025 10:01 pm
Hi

Glad it is working and happy to have been of some help.

Regards
Thank you very much for all the help provided !!!!!

C.

Carmelo
Posts: 121
Joined: Thu Oct 14, 2021 10:04 am
Has thanked: 49 times
Been thanked: 4 times

Re: Sensor DS18B20

Post by Carmelo »

I have the project finished and tested working perfectly.
But I wanted to make a modification by adding a new interruption but it won't let me select the type of interruption to insert (TMR1)
What could it be due to?
Attached to the file

C.
Attachments
Termostato_Test.fcfx
(148.71 KiB) Downloaded 10 times

chipfryer27
Valued Contributor
Posts: 1528
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 353 times
Been thanked: 549 times

Re: Sensor DS18B20

Post by chipfryer27 »

Hi

I have just added in "Main", an Interrupt Icon and could select Tmr1. This then compiled without issue.

You have many macros in your chart and it isn't possible to go through every one, so if you could be more specific as to where you are placing, maybe that would help narrow it down.

Your chip also has a Timer0 and Timer2 interrupts. Could they help?

Regards

Carmelo
Posts: 121
Joined: Thu Oct 14, 2021 10:04 am
Has thanked: 49 times
Been thanked: 4 times

Re: Sensor DS18B20

Post by Carmelo »

Gracias por la respuesta.
Quería añadirlo dentro del main, justo detrás de la interrupción delRB0.
Se abre la ventana de configuración pero no me permite elegir ningún tipo de interrupción.

C.

Carmelo
Posts: 121
Joined: Thu Oct 14, 2021 10:04 am
Has thanked: 49 times
Been thanked: 4 times

Re: Sensor DS18B20

Post by Carmelo »

I closed Flowcode completely and when I run it again it works fine again.
I don't know what could have happened.
Thank you for taking the trouble to review it.

C.

Post Reply