Atmel AVR to 1 wire bus
Here
is some C for the Atmel AT90S8515 microcontroller written with AVR
GCC. It is a general purpose Dallas 1 wire bus interface that you control
via RS232. It doesn't program EPROMS (no 12V drive) but maybe I'll
add that later. I use AVR
Dude to talk to my micro, as well as AVR libc (handy stuff
like printf..). I'll put up the schematic I used up, but it's
pretty basic.
The code produces output like the following
===============
Inited!
> sr
10:5a:cf:4e:00:08:00:d4
09:42:81:85:03:00:00:6d
> te 10:5a:cf:4e:00:08:00:d4
temperature 25.0
> rs
Resetting... Presence
> rb
Read a 0xff
> wr 0
Wrote a 0
> re
Read a 1
> ?
rs Reset and check for presence
re Read a bit
rb Read a byte
wr bit Write a bit
wb byte Write a byte (hex)
wc cmd [ROMID] Write command
te ROMID Read the temperature from a DS1820
>
Links
Daniel O'Connor
Last modified: Sat Sep 17 18:19:21 CST 2005