GithubHelp home page GithubHelp logo

urish / wokwi-ds1820-custom-chip Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bonnyr/wokwi-ds1820-custom-chip

0.0 1.0 0.0 198 KB

License: MIT License

C++ 7.89% Python 0.34% C 91.17% Makefile 0.61%

wokwi-ds1820-custom-chip's Introduction

wokwi-ds1820-custom-chip

chip data sheet

The DS18B20 Custom Chip simulates the Dallas Semi (Maxim Integrated) One Wire Temperature Sensor of the same name.

The chip has the following pin groups

Name Description
Vdd Power pin
GND ground pin
DQ Data Pin, used as I/O pin

Addressing

The device uses OneWire compatible addresses, configurable as described below

OneWire Comms

The device uses OneWire for comms with the MCU. This custom chip implements a OneWire Slave (only)

A good Arduino library to use on the Arduino side is the OneWire Server Library (TBD)

Implementation details

This chip supports all the functions of the hardware part. Commands are listed below

Reset

Write only. Resets the chip to power on.

Search

The device responds to the search command.

Read

The device replies with its serial no bytes.

Match

The device performs a match to the address sent by the master.

Skip

The device skips to wait for function command.

Alarm Search

TBD: not implemented yet.

Convert

The device stores the temperature that is configured through diagram.json into the scratch pad.

Write Scratchpad

The device writes the Th, Tl and Cfg bytes into the scratch pad.

Read Scratchpad

The device transmits the contents of the scratch pad (9 bytes) to the master

Copy Scratchpad

The device copies the contents of the Th, Tl and Cfg bytes from the scratchpad to its eeprom

Recall

The device copies the contents of the Th, Tl and Cfg bytes from its eeprom to the scratchpad

Read Power Supply

The device behavior depends on the value of deviceMode attribute see below When configured in Parasitic mode, the chip will pull down the wire when requested to indicate as much. When configured in Vdd mode, the chip will leave the wire floating.

Attributes

The chip defines a number of attributes that alter the behavior of the operation when used in Wokwi.

Name Description Default value
ow_debug controls debug output for base one wire link layer code "0"
gen_debug controls debug output for the chip code "0"
deviceMode controls whether the device behaves as if it was connected to Vdd or uses parasitic voltage "0"
deviceID Specifies the unique 48bit device serial number. This is a string and the value should be limited to precisely 12hex digits
Note the device serial's CRC is calculated during init
"010203040506"
familyCode Specifies the device family code. Supported values include 0x10, 0x22, 0x28 "0x10"

Simulator examples

Limitations and ommissions

Power Mode

power mode is currently fixed at parasitic

Convert Temperature in Parasitic mode

In this mode, the master is pulling the bus high for a period of at least 10us during which no activity takes place on the bus. The current implementation completes the conversion immediately and is going back to the init sequence. This is likely not an issue, but it deviates from the spec somewhat

Read Power Mode

Currently we're ignoring the power mode configuration attribute and assume parasitic mode

wokwi-ds1820-custom-chip's People

Contributors

bonnyr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.