简体   繁体   English

如何使用Atmega 32从DALLAS 18B20获得价值

[英]How to take value from DALLAS 18B20 using Atmega 32

I have atmega 32 and DALLLAS 18b20. 我有atmega 32和DALLLAS 18b20。 the out put of the temp sensor is digital in one wire. 温度传感器的输出是一线数字的。 can any one suggest me how to read the value using ADC channel. 谁能建议我如何使用ADC通道读取值。 thanks in advance. 提前致谢。

As Colin_s says, the communication with the 18b20 is digital over a port pin, ie, 0s and 1s. 正如Colin_s所说,与18b20的通信是通过端口引脚(即0和1)进行数字通信的。

Here is the datasheet for the sensor. 是传感器的数据表。

Here is an application note from Atmel telling you how to interface the AtMega32 with the sensor. 是Atmel的应用笔记,告诉您如何将AtMega32与传感器连接。 Basically, you change the direction of the port pin to input or output at the correct times to release or control the 1-wire, send commands to the sensor, and read results from the sensor over this pin. 基本上,您可以在正确的时间将端口引脚的方向更改为输入或输出,以释放或控制1线制,向传感器发送命令,并通过该引脚从传感器读取结果。 You "bit-bang" the commands and readings by sending or reading the hex values one bit at a time, least significant bit first. 通过一次发送或读取十六进制值(最低有效位在前),您可以对命令和读数进行“位撞击”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM