smurfix / owslave

1wire slave code for AVRs
http://wiki.github.com/smurfix/owslave/
GNU General Public License v3.0
66 stars 20 forks source link

owslave atmega8 #4

Open nkrk opened 12 years ago

nkrk commented 12 years ago

Hi Again Please help to me run ow slave on ATmega8

now program works in Proteus but on real chip doesn't If I connect chip with program to 1-wire lan all devices disappear :( Also notice follow bug. In proteus it works only if I monitoring 1-wire lan with oscilloscope. If I remove oscilloscope it dosn't work again

Can anybody help me?

smurfix commented 12 years ago

Hi,

nkrk:

Also notice follow bug. In proteus it works only if I monitoring 1-wire lan with oscilloscope. If I remove oscilloscope it dosn't work again

So you have a timing problem. The probe is likely to slow down the signal, due to increased capacitance. Enough that it works.

Can anybody help me?

Look at the scope output and the 1wire timing requirements ... not much else I can say without having the hardware.

-- Matthias Urlichs

nkrk commented 12 years ago

So you have a timing problem.

Actually I have changed your timings to the following, because with your timings program doesn't work atall (in proteus and in chip too) now Iam using following timing section (after comment // I wrote datasheet timings):

define T_(c) ((F_CPU/PRESCALE)/(1000000/c))

define TPRESENCE T(100) //60..240

define TPRESENCEWAIT T(20) //15..60

define TSAMPLE T(12) //

define TXMIT T(60) //60..120

define TRESET T_(480) // >= 480

define T_RESET (TRESET-T_SAMPLE)

if (T_RESET>200)

error Reset slot is too wide, fix timing

endif

The probe is likely to slow down the signal, due to increased capacitance. Enough that it works.

about what capacitance you say?

ps: I use atmega8 at 16MHz. because if I use 8MHz (as you wrote in src file) 1Wire timings was wrong

smurfix commented 9 years ago

Timing should now be much better. Macros are tested at 8 and 16 MHz, pulldown is in assembly code to be as fast as possible.