2 X 1Wire individual pin on one mikokontroler

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
rradojko
Posts: 40
Joined: Thu Jun 21, 2012 8:53 am
Has thanked: 10 times
Been thanked: 2 times

2 X 1Wire individual pin on one mikokontroler

Post by rradojko »

Hello to everybody.

I'm new to the forum.
I have one question. It is possible to the microcontroller ATmega32 create 2 X 1Wire the pin PB0 and PB1?
How to define two input 1Wire?
To better understand the attach picture.

Thank you very much for the answer.

Radojko
Attachments
2 X 1Wire.JPG
2 X 1Wire.JPG (30.72 KiB) Viewed 8268 times

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 2 X 1Wire individual pin on one mikokontroler

Post by Enamul »

You can use two one wire device in the same port pin by using one pull-up resistor but the data line will be tied together and connected to that one pin of PIC..In code we can identify two chip as they have different address.
Enamul
University of Nottingham
enamul4mm@gmail.com

rradojko
Posts: 40
Joined: Thu Jun 21, 2012 8:53 am
Has thanked: 10 times
Been thanked: 2 times

Re: 2 X 1Wire individual pin on one mikokontroler

Post by rradojko »

Sorry for bad english
I understand that it can be 1wire pin connected more DS18S20.
But it's complicated for me. I would like to skip addressing
I would like to connect DS18S20 on each individual pin.
This connection is much more understand for me.

Any other a suggestion?

rr

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: 2 X 1Wire individual pin on one mikokontroler

Post by Enamul »

But that will complicate code much more...
Enamul
University of Nottingham
enamul4mm@gmail.com

Flaterick

Re: 2 X 1Wire individual pin on one mikokontroler

Post by Flaterick »

Hello

Flowcode can skip any real sensor address (ROM code), but only the addressing and read out the temperatures individually.

Find it very sad that is advertised with a 1Wire support, and then it is not possible to read the serial number, and so the sensors should be done directly speaking.

Mfg.
Matthias

sory for bad english

rradojko
Posts: 40
Joined: Thu Jun 21, 2012 8:53 am
Has thanked: 10 times
Been thanked: 2 times

Re: 2 X 1Wire individual pin on one mikokontroler

Post by rradojko »

If I DS18S20 the individual pin then you can skip address and reading code.
But flowcode but allows only one 1wire one pin.
Use the C code in the project, do not know how.

Any suggestions…

rr

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 2 X 1Wire individual pin on one mikokontroler

Post by Benj »

Hello,

Can you add a second one wire component and connect this to your second pin?

rradojko
Posts: 40
Joined: Thu Jun 21, 2012 8:53 am
Has thanked: 10 times
Been thanked: 2 times

Re: 2 X 1Wire individual pin on one mikokontroler

Post by rradojko »

Thanks for answer.

The problem is Flowcode4 It allows only one component 1wire.

rr

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 2 X 1Wire individual pin on one mikokontroler

Post by Benj »

Hello,

Ok please make a backup of your current component C file and then try replacing the current file with the one here.
PIC_One_Wire.c
(22.59 KiB) Downloaded 357 times
The file should be located here, "C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\Components"

There may be compilation errors with two versions of the component as it wasn't designed for this in v4, worth a shot though and should be easy enough to sort out.

Let me know how you get on.

rradojko
Posts: 40
Joined: Thu Jun 21, 2012 8:53 am
Has thanked: 10 times
Been thanked: 2 times

Re: 2 X 1Wire individual pin on one mikokontroler

Post by rradojko »

Hello.

I used the attached file PIC_One_Wire.c. When translated into HEX code return error.

Attach PIC_One_Wire.c C code from Flowcode4. Code works, but I can use only 1 x 1Wire pin.

Beny, or you can check the attached code? Your attached code is not working correct.

Benj, can you please stick also “C” code for AVR one wire.

How you can help.
RR
Attachments
(Flovcode4)_PIC_One_Wire.c
(Flowcode4)_PIC_One_Wire.c
(19.5 KiB) Downloaded 300 times

rradojko
Posts: 40
Joined: Thu Jun 21, 2012 8:53 am
Has thanked: 10 times
Been thanked: 2 times

Re: 2 X 1Wire individual pin on one mikokontroler

Post by rradojko »

Hello.

Again, please help.
I tried 2x onewire in Flowcode5 2x single pin. I use ATMEGA32 microprocessor.
Use sensors DS18S20. Are connected to pinD2 and pinD3.
One sensor is working properly connected to pinD2.
A sensor on the pinD3 shows the same temperature as the sensor pinD3.

How to properly write a program, i measured two temperature?

I attach my program to AVR atmega32.

What am I doing wrong? Please Help.

Thanks and best regards.
Attachments
OneWire_2X_pin_PD2_in_pin_PD3_Mega32.jpg
OneWire_2X_pin_PD2_in_pin_PD3_Mega32.jpg (93.46 KiB) Viewed 7799 times
2x_temperature_2x_DS18s20.fcf_avr
(10.5 KiB) Downloaded 278 times

Sean Danaher
Posts: 13
Joined: Thu Oct 15, 2009 9:16 am
Has thanked: 3 times
Been thanked: 1 time

Re: 2 X 1Wire individual pin on one mikokontroler

Post by Sean Danaher »

I'm sure this can be done but I'm not sure why. I have successfully connected twelve daisy-chained DS18B20 to the same 1-wire line using an Arduino

Look at this link for information etc Link removed at site owners request

rradojko
Posts: 40
Joined: Thu Jun 21, 2012 8:53 am
Has thanked: 10 times
Been thanked: 2 times

Re: 2 X 1Wire individual pin on one mikokontroler

Post by rradojko »

Hello,

Sean Danaher, very nice and interesting project.
In which language you programmed? Flowcode?
Unfortunately, I do not know how to program.

Greetings!

RR

Post Reply