docs: add comments for parasite power mode

This commit is contained in:
IOsetting 2022-06-06 02:03:01 +08:00
parent a41cba9eec
commit b7c33775c0

View File

@ -17,9 +17,19 @@
* *
* Board: STC8H3K32 * Board: STC8H3K32
* *
* Normal Power Mode:
* P35 -> DQ * P35 -> DQ
* GND -> GND * GND -> GND
* 3.3V -> VCC * 5V/3.3V -> VDD
*
* Parasite Power Mode:
* Parasite power mode requires both DS18B20 GND and Vdd to be
* connected to ground. The DQ pin is the data/parasite power line,
* which requires a pull-up resistor (set by PxPU command)
*
* P35 -> DQ
* GND -> GND -> VDD
* 5V
*/ */
#include "fw_hal.h" #include "fw_hal.h"
@ -46,6 +56,10 @@ int main(void)
while(1) while(1)
{ {
DS18B20_StartAll(); DS18B20_StartAll();
/*
In Parasite Power Mode, replace the while block below with
SYS_Delay(x), x can be [500, 1000]
*/
while (!DS18B20_AllDone()) while (!DS18B20_AllDone())
{ {
UART1_TxChar('.'); UART1_TxChar('.');