Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

1-wire Search ROM routine

Status
Not open for further replies.

Inkwaterman

Member level 1
Joined
Apr 28, 2004
Messages
32
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
360
search rom

Hi !
I have to interface a PIC to a 1-wire bus with 3 devices.

I have just used some 1-wire devices , but I haven't used a 1-wire bus.

Has anybody done a 1-wire Search ROM routine ?

If it's possible , can you post me your source code ?

Tnx
 

rom search

Hi,
i am making also a interface between Microcontroller MSP430f149 and multilple ibuttons devices through Transport DS2484. search algorithem now i am writing but this is not complet...i am also finding some guy who has some ideas about it...if u got some solution plz inform me also..irfan
 

    V

    Points: 2
    Helpful Answer Positive Rating
one wire search rom

Hi !

in my case I had to interface some 1-wire devices with a Microchip PIC, for did it I used a PIC's PIN , without any Transport DS2484.

If you want I can post you my code, it works well .

The only thing that you have to do is to adapt it to your requirements ..

Regards
 

search rom ds1820

Hi..


it will be nice if u send me ur code...i will change it according to my requirement...because basic search algorithum work on the same way..i am waiting ur answer thanks alot irfan
 

ds18s20 search rom

I have a 1-wire Search ROM routine write in CCS. If you are interested, i post it.
 

onewire search rom

hi martinisonline,

i'm interested too. can you post you code?

best regards,
stroma
 

routine c one wire

I atached a complete working project i made some time ago. It's about the DS1820 (Digital temperature sensor) that works over a onewire bus.

It includes:
onewire.c driver
ds1820.c driver
main.c file of project.

It will search all devices atached to the bus, and indexes them. If one device is disconnected or connected, it will perform a new search index.

the files have some comments in english and most of them in portuguese. If you have some problem, post it.
 
ds18s20 rom code

nice work- very useful for me, thanks a lot

best regards,
stroma
 

ds18b20 search rom

Tnx for code, I tried and compiler could not find LCD driver and header for 1820.

Is it possible to upload this too.

Regards

BOjan
 

ccs one wire routines

The driver for ds1820 is already attached in the previous post. you need to put it in the C:\???????\PICC\Drivers. or define in the options in ccs another directory for the drivers.

The driver for flex_LCD wasn't made by me, but it has usefull coments. it's easy to understand.
 
ds18s20 search rom microchip

you can find at maxim website
 

www. search-roms .com

Finaly I made, very useful, TNX
Your CODE is working in my test board. But now I have new problems.

I do not have debagger circuit for testing code step by step.

Which variable present temperature ?

Bojan
 

pic one wire search

At main.c file after "lcd_init()":

procurar(); -> search all devices in the bus

convert_temp(); -> send to the bus the code to start a temperature conversion to all devices.

read_temp(dados, i); -> read the value of device 'i' and save it in the variable 'dados'

trata_temperatura(dados); -> Do a math calculation to get the extended resolution (see ds1820 datasheet, pag. 4) and put the value at "inteiro" and "decimal"


the value of temperature is known after the function 'trata_temperatura(dados);"
Value: AA,BB ºC where: AA -> "Inteiro" and BB -> "Decimal"

You need to format the printf like the example at main.c:
printf(lcd_putc,"Int.: %02u,%02u 'C ",inteiro, decimal);

i had 2 sensors. one inside and other outside the room. The Int.: in the lcd is the inside temp. and the Ext.: is the outside temp.
 

1wire search rom

HI

I was successful to read 64 bit ROM adress from my 18S20 and manualy write it to program.
Program detect the sensor, but does`t show correct temperature. LCD alveys show
3,39 C even to worm sensor with fingers.

Any idea where is problem?

Regards Bojan
 

1 wire search rom

probably the problem is the funtion "read_temp(dados, i)". After the funtion "procurar()", the program 'enumerates' the devices (1, 2, 3, ...).


go to the onewire.c driver, at funtion "void FindDevices(void)" delete the \* and *\:

//******************************************************************************
// DESCRIÇAO: Procura novos dispositivos no bus
//
// INPUT: Nada
//
// OUTPUT: Nada

//------------------------------------------------------------------------------
void FindDevices(void)
{
int8 m;

if(!ow_reset())
{
if(First()) // Begins when at least one part found
{
numROMs = 0;

do
{
numROMs++;

for (m=0;m<8;m++)
{
FoundROM[numROMs][m] = ROM[m]; // Identifies ROM no. on device
}
/* <---DELETE THIS
printf("\r\nEndereco do dispositivo No %u: ",numROMs);

printf("%X%X%X%X%X%X%X%X\n\r",
FoundROM[numROMs][7],FoundROM[numROMs][6],FoundROM[numROMs][5],
FoundROM[numROMs][4],FoundROM[numROMs][3],FoundROM[numROMs][2],
FoundROM[numROMs][1],FoundROM[numROMs][0]);
*/ <---DELETE THIS
} while (Next() && (numROMs<10)); // Continues until no additional
// devices found.
// printf(lcd_putc,"\fTotal Disp.: %u",numROMs);
// delay_ms(500);
}
}
// putc('\n'); putc('\r');
}
//******************************************************************************

now you can view in hyperterminal the rom code and the device number (I assume that you are using rs232)

At main.c edit one of the "IFs" with your DS18S20 rom code.

my example:
//edit---------------------|-------------------------------|------------------------------|---...
if(FoundROM[7]==0xe1 && FoundROM[6]==0x00 && FoundROM[5]==0x08 && FoundROM[4]==0x00 && FoundROM[3]==0xc4 && FoundROM[2]==0x8f && FoundROM[1]==0xbb && FoundROM[0]==0x10){
//se o chip do interior corresponde ao ROM //E1000800C48FBB10 <-- Rom code


After this, if you have problems, post your code.
 

1-wire search routine

hello, I tried the code above, just go try to adapt to ds18b20 ..... which have to adjust .... comments are in Spanish and do not understand
 

hello,
i done the "rom search" routine in assembler
contact me at ---abric.jy@libertysurf.fr---
or go to the french site "pic mcu" of "BIGONOF" in application from "abric jean-yves"
 

I'm from Spain and the comments are in Portuguese, not in Spanish ¬¬ Learn languages before talking so bravely.
 

Thanks to martinisonline I made ROM search work for the Rabbit RCW5600W module. Needed tweaked timing and disabling interrupts at critical moments. (used an oscilloscope for debugging :)

PS: I found you really need a 4k7 pull-up, I got inconsistent results with a 10k resistor.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top