Hi,
For our application a digital to analog converter is being used that requires a 16-Bit control signal, however the toolbox is only allowing me to send an 8-bit signal. Is there anyway around this?
Thank you in advance for your help,
Fernando
解決済! 解決策の投稿を見る。
Hello fernando.barrios@uwaterloo.ca,
The link to the 2nd picture is broken so I can not see it.
In your model I saw that you set the baud rate to 80MHz - that is not a valid value; the SPI will go up to 8MHz. You can take this example and see if it works (note that I change 1 pin from your configuration for easier testing; you can change it back to what you previously had).
Here is the SPI running at 1MHz - you can edit the settings in the SPI Config block and make it run at 8MHz also.
Kind regards,
Razvan.
Hello fernando.barrios@uwaterloo.ca,
Yes, you can send 16bit messages through SPI - select the Frame size to be 16 bits and use a data store memory with dimension minimum 2 uint8s.
The transfer block sets the transfer width according to its input.
Note: the width of the data memory store should be multiple of 2 (because you've set 2bytes as the frame size).
I've attached a simple example here. Hope this helps.
Kind regards,
Razvan.
I appreciate your model and help, unfortunately I could not get it working still only using C code. The following is the SPI timing specs;
And in C the configuration that worked was as follows (it was tested with both 8 and 16 bits);
In Simulink I have it set up as follows with the memory block using uint8(2);
I believe these should be correct, I have tried various different configurations with the test file to get this to work on simulink with no luck.
Please let me know if you have any other suggestions.
Thank you,
Fernando
Hello fernando.barrios@uwaterloo.ca,
The link to the 2nd picture is broken so I can not see it.
In your model I saw that you set the baud rate to 80MHz - that is not a valid value; the SPI will go up to 8MHz. You can take this example and see if it works (note that I change 1 pin from your configuration for easier testing; you can change it back to what you previously had).
Here is the SPI running at 1MHz - you can edit the settings in the SPI Config block and make it run at 8MHz also.
Kind regards,
Razvan.
It works great, thank you for all your help!
Have a good weekend,
Fernando