Can simulink use TI C2000 LAUNCHXL-F28027F or F2808 to monitor a analog signal (200KHz)?

56 vues (au cours des 30 derniers jours)
fuxin zhou
fuxin zhou le 24 Août 2017
Réponse apportée : Antonin le 29 Août 2017
Hi there,
I"m new to the C2000. I would like to use simulink with F28287 or F2808 to monitor a analog signal at about 200KHz. I have used the XDS100v2 with LAUNCHXL-F28027F to do testing. Under Matlab2017a and CCS5.
The communication interface is serial in the external mode. And the analog signal display in the scope is very poor and can only take a few Hz.
There another communication prototype-CAN is also available in external mode. However I do not how much frequency it can achieve.
I would like to ask.
1. Using simulink using serial communication prototype can monitor a analogue signal at 200KHz? How I could achieve this?
2. How about 'CAN' method, How fast it can achieve in external mode?
3. Are there any other hardware or method can be used in simulink for monitoring a signal at 200KHz?
I am really appreciated for any help. Thank you very much.

Réponses (4)

Antonin
Antonin le 25 Août 2017
Modifié(e) : Antonin le 25 Août 2017
Hi Fuxin,
  • First here are steps to get started with External mode:
First make sure to have the latest version of the Embedded Coder Support Package for Texas Instruments C2000 Processors as we made recent changes to our External mode implementation.
Here is a help page to setup serial communications with the hardware.
Now let's speed things up :-)
  • Cranking External mode:
External mode uses SCIA to communicate between the host and the target and will use the baudrate that you have set in your configuration parameters. For better experience with External mode, make sure to increase the baudrate for SCIA.
If using a recent controlCard or Launchpad, the serial over USB chip (FTDI FT2332H family) can accept any baudrates up to 6 Mbps or exactly 9 Mbps or exactly 12 Mbps.
If using a older controlCard or docking station, the serial over USB chip (FTDI FT2332D family) can accept any baudrates up to 1.5 Mbps or exactly 2 Mbps or exactly 3 Mbps.
If using the F28027 LaunchPad, you can go up to 3.75Mbps which is the max that the processor can do.
By doing this you can log signals up to ~5kHz after which you may experience gaps in your logged data.
  • Buffered External mode
Monitoring buffers at a slower rate allows you to run External mode simulations and watch signals at higher rates. I recently posted an example on how to do this on the F28379D Launchpad. The same technique can be applied with the F28027 Launchpad. I was able to watch signals at 20kHz with this technique on the F28379D Launchpad. This requires more memory on the target, you may have to increase the heap size to be able to run External mode. Look at the models I provided on this page, in the configuration parameters of the model, under "code generation", I selected "specify" for the "Build configuration", and in the linker string, I changed the "--heap_size" from the default value.
  • 2-model approach
This is the fastest way to log data in realtime, as you can specify your own light weight protocol. The idea is to create 2 models, one that runs on the target and sends data to serial. the second one that runs on the host and gets data from the target. I show a full example running a DC/DC buck converter demo where I log 2 uint16 signals at 200kHz with this technique. Watch the video on the page for full details of how to implement this technique. I'm using the F28377S Launchpad in this demo, but the same technique can be applied on the F28027 Launchpad.
I hope it helps,
Thanks,
Antonin.
  1 commentaire
fuxin zhou
fuxin zhou le 25 Août 2017
Hi Antonin,
Thanks for your reply. I have tried your buffered External mode with F28027 LaunchPad.I used:
1. Matlab2015b
2. C2000 package:15.2.6
3. CCS5
The design passed compiling and run on the hardware. But I am failed to see waveform in scope. I also tried other design method, but it is also failed at monitoring signal. I can change the parameter or switch but can not use scope. Do you have any idea about this issue? I have attached my configuration for your consideration.
Thanks

Connectez-vous pour commenter.


Antonin
Antonin le 28 Août 2017
Hi Fuxin,
We made drastic improvements to External mode in R2016b. You will not be able to reproduce the External mode results I posted earlier in R2015b. The only approach that can give you good results in R2015b is the 2-model approach. I would recommend upgrading if this is possible on your side.
I hope it helps,
Thanks,
Antonin.
  2 commentaires
fuxin zhou
fuxin zhou le 28 Août 2017
Modifié(e) : fuxin zhou le 28 Août 2017
Hi Antonin,
Thanks for your reply. I have download the Matlab2016b on my computer. I ran same smulink design in Matlab2016b as Matlab2015b. But I got 3 errors from Matlab2016b. There are:
"C:/ProgramData/MATLAB/SupportPackages/R2016b/toolbox/target/supportpackages/tic2000/src/ext_svr_c2000.c", line 257: error: argument of type "uint8_T *" is incompatible with parameter of type "const char *"
"C:/ProgramData/MATLAB/SupportPackages/R2016b/toolbox/target/supportpackages/tic2000/src/ext_svr_c2000.c", line 257: error: argument of type "uint8_T *" is incompatible with parameter of type "const char *"
"C:/ProgramData/MATLAB/SupportPackages/R2016b/toolbox/target/supportpackages/tic2000/src/ext_svr_c2000.c", line 555: error: argument of type "uint32_T *" is incompatible with parameter of type
These error also arised in Matlab2017a. But the older version of Matlab such as 2014 and 2015, they do not have these problem. Do you have any idea I could fix these? Thanks you very much.
Best regards
Update 28/08/2017
These problem has been solved by updating CCS5 to CCS6. Thanks
fuxin zhou
fuxin zhou le 28 Août 2017
Hi Antonin,
Do you have any other recommended hardware board for monitoring signal. I would prefer to use a faster board. I am stuck with the communication speed between hardware and Simulink.
Thank you very much.

Connectez-vous pour commenter.


Antonin
Antonin le 29 Août 2017
Hi Fuxin,
You could use the F28377S LaunchPad which has more memory and where you could bump the serial communications to 12Mbps.
I hope it helps,
Thanks,
Antonin.
  1 commentaire
fuxin zhou
fuxin zhou le 29 Août 2017
Hi Antonin, Thank you very much for your reply. I used F28379D Launchpad which has Up to 204 KB SRAM. I have rerun the design as F28027 and set new port number and SIC_A. I can deploy code into hardware, but I got MATLAB Simulink external mode errors as:
Build process completed successfully
Verbose mode is enabled for External mode. You can disable Verbose in Model Configuration Parameters > Hardware Implementation > Target Hardware Resources > External mode.
Output port 1 of 'Extmode_straight/Counter Free-Running' is not connected.
Component:Simulink | Category:Blockwarning
action: EXT_CONNECT
Component:Simulink | Category:Model
Error occurred while executing External Mode MEX-file 'ext_comm':
Failed to connect to the target. A time-out occurred while waiting for the connection response from the target. Possible reasons for the time-out:
a) The target is not switched on.
b) The target is not connected to your host machine.
c) The application for the model is not running on the target. You might have clicked the Stop button. If the Run button is not dimmed, click it. Otherwise, click the Build button, which downloads and runs your application on the target.
I have rechecked
I could connect CCSv6 with F28379D properly, but I can not connect F28379D with simulink?
This is the same problem as nam dinh in this thread comment section.
https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/543547#pi316717=3

Connectez-vous pour commenter.


Antonin
Antonin le 29 Août 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by