Using Dallas DS1820 with Mod5270

Discussion to talk about software related topics only.
Post Reply
premiaware
Posts: 11
Joined: Tue Jun 17, 2008 5:25 am

Using Dallas DS1820 with Mod5270

Post by premiaware »

Hi

Is possibile to use temperature sensor dallas DS1820 using GPIO port of MOD5270? is possibile to config the port in Read/Write mode anche use the I/O port for send and receive the data from sensor? Some of you know where to find examples of application?

Many thanks for any help you give me know


Luca
Ridgeglider
Posts: 513
Joined: Sat Apr 26, 2008 7:14 am

Re: Using Dallas DS1820 with Mod5270

Post by Ridgeglider »

see the onewire communications thread http://forum.embeddedethernet.com/viewt ... &sk=t&sd=a as well as larry's stopwatch code http://forum.embeddedethernet.com/viewt ... ?f=7&t=397
for timing the usec delays. Reading and writing to and from the pin should be straightforward with the pin I/O class library: http://www.netburner.com/downloads/mod5 ... -PinIO.pdf. Note that the pin class varys by device, so see http://www.netburner.com/support/techni ... ml#mod5270 for the other related appnotes.
premiaware
Posts: 11
Joined: Tue Jun 17, 2008 5:25 am

Re: Using Dallas DS1820 with Mod5270

Post by premiaware »

Thank'you for your support,

but you using one line of GPIO of 5270 in read/write mode or you using two lines of GPIO one in read mode and one in write mode???

I have try to use different software and hardware solution witout success ! :cry:
v8dave
Posts: 333
Joined: Thu Dec 31, 2009 8:31 pm

Re: Using Dallas DS1820 with Mod5270

Post by v8dave »

Good day,

If you use 2 IO pins you need to make sure that the driving output goes to HIz when not outputing otherwise you will require some additional parts to do this. Ideally when in the HIGH state as you would use a pullup to hold the bus at +V.

Another option you might consider is the following Maxim part that you control via the I2C bus on the Netburner.

http://www.maxim-ic.com/quick_view2.cfm/qv_pk/4382

Might make your design simpler if you have the budget for this part?

Dave...
User avatar
Chris Ruff
Posts: 222
Joined: Thu Apr 24, 2008 4:09 pm
Location: topsail island, nc
Contact:

Re: Using Dallas DS1820 with Mod5270

Post by Chris Ruff »

One way I have done this is with two lines on MOD7270 data bus. using D0 and D1: D0 is an input and monitors 1-wire net through 33 ohms. 1-wire net is pulled up to 5 volts with 2.2k resistor. D1 is an output and drives 1-wire net through a 1n4148 diode. D1 connects to the cathode.

When you think about 1-wire:

1. all 1-wire devices only pull 1-wire net down.
2. 1-wire only goes hi because of the 2.2k resistor.
3. 1-wire is sensitive to only certain timing issues. there are many other issues that are not tight such as the time between characters.
4. after you have commanded 1-wire in some manner, you have to set your D1 hi and let the 1-wire communicate back before talking again

Chris
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand
premiaware
Posts: 11
Joined: Tue Jun 17, 2008 5:25 am

Re: Using Dallas DS1820 with Mod5270

Post by premiaware »

Hi to all,

If is possibile i want use only one GPIO of 5270, I have atteched scheet of my hardware

Based on your experience my hardware is correct?

I can not tell if the problem is hardware or software, this is my first experience with DS1820 sensor.

I set my GPIO in this mode:
sim.gpio.par_feci2c &= ~ (GPIO_PAR_SDA | GPIO_PAR_SCL);

// SDA OUT
sim.gpio.pddr_feci2c |= GPIO_PIN_SDA;
sim.gpio.dscr_feci2c &= ~(0x01);

and I control the state in this mode:

void Set_OUT(bool bSet)
{
if (bSet)
sim.gpio.podr_feci2c |= (GPIO_PIN_SDA);
else
sim.gpio.podr_feci2c &= ~(GPIO_PIN_SDA);

}

unsigned char DQ_RX ()
{
return sim.gpio.ppdsdr_feci2c & GPIO_PIN_SDA ? 0x01 : 0x00;
}
Attachments
ds1820.txt
(471 Bytes) Downloaded 372 times
Post Reply