[uquote="Dimon456",url="/forum/viewtopic.php?p=3731648#p3731648"]
ondyon писал(а):В интернете куча примеров, где люди просто включали ds2408 на линию 1-wire без извращений,
и одна и та же библиотека используется, пример этой библиотеки есть в примерах протеуса 8.8 SP1.
Библиотека из протеуса заработала только[/uquote]
Спасибо! а лежит ли она где-нибудь отдельно? Тяжко весь протеус качать торрентом
Попробовал таймауты поставить как в примере - не помогло, там же валится на ресете.
Где линия ставится в LOW, потом ждут 480(960) мкс
потом читают и это должно быть 0 (а оно 1)
попробовал ждать в цикле. ds18d20 ставит 0 примерно на 20 мкс
ds2408 не ставит совсем
Добавлено after 28 minutes 39 seconds:
Ответ на вопрос, заданный выше про повышенную скорость.
В даташите:
A Reset Pulse followed by a Presence Pulse indicates the DS2408 is ready to receive data, given the correct ROM and control function command. If the bus master uses slew-rate control on the
falling edge, it must pull down the line for tRSTL + tF to compensate for the edge. A tRSTL (РЕСЕТ ИМПУЛЬС!) duration of 480µs or longer
will exit the overdrive mode returning the device to standard speed.
After the bus master has released the line it goes into receive mode (RX). The 1-Wire bus is then pulled to VPUP via the pullup resistor or, in case of a DS2480B driver, by active circuitry. When the VTH threshold is crossed, the DS2408 waits for tPDH and then transmits a Presence Pulse by pulling the line low for tPDL. To detect a presence pulse, the master must test the logical state of the 1-Wire line
Короче, чтобы дать ресет, надо линию опустить на землю на 480 мкс или более. Эта же операция
сбросит ускоренный режим.
Потом включить режим INPUT и слушать
В ответ микруха тоже опустит линию на землю на какое-то время. Импульс надо ловить тоже примерно 480 мкс.
Ловлю импульс в цикле, чтоб не пропустить. ds18d20 отвечает на 20ой микросекунде.
ds2408 не отвечает
всё же, похоже, хардварные проблемы. Горелые микрухи у меня боюсь
Добавлено after 3 seconds:
Ответ на вопрос, заданный выше про повышенную скорость.
В даташите:
A Reset Pulse followed by a Presence Pulse indicates the DS2408 is ready to receive data, given the correct ROM and control function command. If the bus master uses slew-rate control on the
falling edge, it must pull down the line for tRSTL + tF to compensate for the edge. A tRSTL (РЕСЕТ ИМПУЛЬС!) duration of 480µs or longer
will exit the overdrive mode returning the device to standard speed.
After the bus master has released the line it goes into receive mode (RX). The 1-Wire bus is then pulled to VPUP via the pullup resistor or, in case of a DS2480B driver, by active circuitry. When the VTH threshold is crossed, the DS2408 waits for tPDH and then transmits a Presence Pulse by pulling the line low for tPDL. To detect a presence pulse, the master must test the logical state of the 1-Wire line
Короче, чтобы дать ресет, надо линию опустить на землю на 480 мкс или более. Эта же операция
сбросит ускоренный режим.
Потом включить режим INPUT и слушать
В ответ микруха тоже опустит линию на землю на какое-то время. Импульс надо ловить тоже примерно 480 мкс.
Ловлю импульс в цикле, чтоб не пропустить. ds18d20 отвечает на 20ой микросекунде.
ds2408 не отвечает
всё же, похоже, хардварные проблемы. Горелые микрухи у меня боюсь