Ale w konfiguracji masz ustawione sterowanie SS przez soft
język c
Musisz się zalogować, aby zobaczyć kod źródłowy. Tylko zalogowani użytkownicy mogą widzieć kod.
Nawet jeśli ustawisz sterowanie przez hardware, to w trybie Master SS może być jedynie wyjściem ( nie wiem jak jest w trybie multimaster - nigdy nie używałem tego trybu, ale to w tym przypadku nieistotne ) do sterowania Slave'a. Nie jestem pewien, co chcesz osiągnąć, ale podejrzewam, że musisz to zrobić programowo.
Pozdrawiam, QuadMan.
Dopisane:
Jeszcze raz przeczytałem Twojego ostatniego posta. Cały problem polega na tym że:
Cytuj:
The TXE flag is set when transmission TXFIFO has enough space to store data to send. TXE flag is linked to the TXFIFO level. The flag goes high and stays high until the TXFIFO level is lower or equal to 1/2 of the FIFO depth. An interrupt can be generated if the TXEIE bit in the SPIx_CR2 register is set. The bit is cleared automatically when the TXFIFO level becomes greater than 1/2. ( RM0091)
Nie możesz użyć tej flagi jako "znacznika" końca transmisji, wobec tego co powyżej. ( No chyba, że ustawisz TXFIFO level na 1/4 - ale w sumie w przypadku nadawania nie warto tego robić. ) Musisz sprawdzać flagę BSY:
Cytuj:
The BSY flag is set and cleared by hardware (writing to this flag has no effect).
When BSY is set, it indicates that a data transfer is in progress on the SPI (the SPI bus is busy).
The BSY flag can be used in certain modes to detect the end of a transfer so that the software can disable the SPI or its peripheral clock before entering a low power mode which does not provide a clock for the peripheral. This avoids corrupting the last transfer.
Czyli, jeśli wyślesz bajt po SPI, to musisz czekać na wyzerowanie BSY, wtedy możesz zmienić stan CE itd...
Sorry, ale faktycznie muszę się porządnie wyspać...