PDA

View Full Version : dallas ibutton to pics



CBUK
- 11th April 2004, 20:32
i have recently delved into the world of dallas semiconductors and have come across the ibuttons (a keyring form of data storage/ ID requiring a simple 1 wire touch to a pod to be read) i have adopted the commands in the proton compiler as the same as that of the 1wire dallas command for example reading the temperature from the 1 wire thermo semiconductor. i have had reasonable success with reading the serial numbers of these devices however the current code patten is just looping on owrites and oreads and if the button is placed on the pad at the right moment (im assuming ) then it will read the 64 bit code which is great as i am developing a security access panel involving a RTC for time stamping but just need a reliable basic code to read these things 1st time round. is it possible to put the program into a trap until it detects the presence of the buttons? has any body had any experiences of these in other suitations?

CBUK
- 16th April 2004, 14:18
ah ha, ive sorted a sloution that seems to be working very well, posted below:

symbol but =portc.6
owrite but,1,[$33h]
delayms 20
oread but,0,[ {values of serial numbers} ]

' the $33h is the address for the button to spew its serial number. there are other commands that you shoud reference to the data sheet for the required memory read/ write/ scratchpad... etc

i have developed the iButtons to form part of a security access scheme with a master key that allows the user to add, delete or change level access for various pin outs on the pic.

if anybody has a spare few hours id strongly recomend you look at the power if these devices! and even the general application of 1-wire communication!

chris

Bosse
- 7th September 2006, 14:29
ah ha, ive sorted a sloution that seems to be working very well, posted below:

symbol but =portc.6
owrite but,1,[$33h]
delayms 20
oread but,0,[ {values of serial numbers} ]

' the $33h is the address for the button to spew its serial number. there are other commands that you shoud reference to the data sheet for the required memory read/ write/ scratchpad... etc

i have developed the iButtons to form part of a security access scheme with a master key that allows the user to add, delete or change level access for various pin outs on the pic.

if anybody has a spare few hours id strongly recomend you look at the power if these devices! and even the general application of 1-wire communication!

chris

Hi Chris,

I'm very interested in your project, becurse I also tries to do an Access Control system with DS1990A. Have no problem to communicate with the iButton, but wants to connect a RTC for logging date (YYMMDDHHMM) in EEPROM (24LC65). One of my problem is that I store the iButton in a simular EEPROM, and if it is to many (over 50) it takes to long time to react on the iButtons in EEPROM. How can I find away to quick check if an iButton is authorized (stored in EEPROM).

Greatful for help

Bosse

Ioannis
- 8th September 2006, 21:41
Well, the search function you are using I suppose is linear. So if the entry to search is the last one then you have to read all the previous ones. If you are lucky only the first byte should be tested.

I think the best method is to use Binary Search. How this works? Have a google on this and you will see. It has nothing to do with hex/bin/dec!

I don't have right now a running code about this but may be get it to finish in a couple of months.

Ioannis

Bosse
- 12th September 2006, 12:39
Well, the search function you are using I suppose is linear. So if the entry to search is the last one then you have to read all the previous ones. If you are lucky only the first byte should be tested.

I think the best method is to use Binary Search. How this works? Have a google on this and you will see. It has nothing to do with hex/bin/dec!

I don't have right now a running code about this but may be get it to finish in a couple of months.

Ioannis

Thank you for your answer, I have only the problem to read the 24LC65 fast enough and find out if the iButton is in the EEPROM fastest possible for Authorization of the iButton in the Reader. Going to try
Binary Search.

Bosse

Bosse
- 25th October 2006, 11:42
Still problems with searching and get the right speed to see if an DS1990A is authorized (stored in EEPROM - 24LC65) Hope to could check about 50 iButton in EEPROM fastest possible. Tried to do a binary search, but have not succed to find a code that works, I'm quit new to program microcontrollers. Write my programs in PICBASIC PRO. Using a PIC16F628, 20 Mhz, going to change to a PIC16F876 with more RAM. Very greatful for all help I can get.
Bosse

Ioannis
- 25th October 2006, 13:55
Can you post the code you have now for the searching?

Also the part that stores the keys in EEPROM.

Have sort them upon storing new key or deleting one?

Ioannis

P.S. Thanks for the wishes.