creating a clock signal for RPi GPIO Simulink
1 次查看(过去 30 天)
显示 更早的评论
RPi Simulink has only GPIOs and no SPI/I2C Blocks yet. This prompts me to make use of the GPIO blocks for the SPI signals. I plan to use GPIO Write for SPI_CLK, SPI_CS and SPI_MOSI and GPIO Read for SPI_MISO. (I was able to communicate to ADC and DAC through this "Software" SPI, i.e. generating the required signals just by series of 0s and 1s. But I wrote this with C).
To start with, I want to create my SPI_CLK and SPI_CS signals in Simulink. Using my model, if i replace the GPIO blocks and connect XY Graph Block to both SPI_CLK and SPI_CS, I see that the SPI_CLK port gives alternating 1s and 0s. SPI_CS port gets to LOW. But as soon as I connect GPIO Write blocks and run on my target Hardware, nothing happens. Both SPI_CLK and SPI_CS are LOW (0V).Connecting a real oscilloscope justifies this.
What is wrong with my model? (Note the Matlab function for my SPI Block is not yet complete. It only has CS and CLK up to this time. Need to resolve this issue first.)
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Raspberry Pi Hardware 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!