Hello! I'm using STM32F103RBT6 microcontroller to communicate with 1-Wire Network, which consist of temperature sensors DS18B20. In order to it efficiently, i'm using USART (USART3). All is fine with writing bit, but i have a problem with readind bit from the buf: To initiate reading bit process host master must pull down the bus for a few microseconds. Please, tell to me what i'm doing wrong. Also i want note very poor information about USART 1-Wire mode.
On 08-05-2009 at 11:59, Anonymous wrote: I check there is data to be read first: [code] .... Chris. Thank you, for your reply, but IMHO it's not sutable for 1-Wire Networks, cause bus master initiates reading from devices, so USART_FLAG_RXNE will be always in RESET state. I need to know, does USART automatically forms start bit, when i call USART_ReceiveData(), or i must for it manualy before calling this function?
My impression is that the 1 wire USART mode is meant for a fixed master/slave relationship, such as a computer driving a printer. You have a two way relationship with your temperature sensor.
The data sheet for this device describes a specially timed initiation sequence to get communication flowing that isn't in your example code. I suggest you bit bang this interface instead of using a USART to ensure you are meeting Maxim's 1 wire bus protocol requirements. Cheers, Hal