The task was to read the code from DS1990
I tried to do this on UART, but nothing comes out
I can send a reset signal and get a response from DS1990. I did it on USART and on UART, for example:
halconf.h
Code: Select all
#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
#define SERIAL_DEFAULT_BITRATE 9600
#endif
main:
Code: Select all
sdStart(&SD1, NULL);
////
uint8_t reset_onewire=0xF0;
uint8_t readrom[8]={0x00,0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF};
while(1)
{
sdWrite(&SD1, reset_onewire,1);
chThdSleepMilliseconds(500);
}
I connected the terminal to the UART and watch the result there.
If DS1990 is connected, then I get the answer E0, and if not, then F0
But the next command should be sent at 115200 baud rate. And I do not know how to change the transmission speed quickly, since if you restart the serial driver from a different configuration it takes a long time
Maybe I'll do it completely wrong?
I hope you understand my English, since I used Google Translate
I use STM32F103C8T6 ( BLUEPILL board)