This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello Guys,
I do have a query regarding matlab configuration for TIVA tm4c123gxl Launchpad and Thanks to Mathsworks they have released embedded coder support for energia.
Well before going to TEXAS TIVA C series,let me tell you about my experience about Arduino compatibility with Matlab. Arduino works great with matlab command line as it has got all the packages to support matlab workspace.You can just read analog values or blink an led and much more stuff with a serial communication port at user defined baud rate.
Leaving the recent embedder coder package for energia remain aside,I just wonder why i am not able to communicate or read and write values to our TIVA MCU through command line through dedicated com port.
if Anybody has worked around it,kindly do the needful here.
for example i just want to read an analog sensor value connected to analog channel A0 in command line.
and please confirm if any package is needed for this communication.
Thanks.
Your best support for Matlab questions will come from Mathworks. Here is the getting started link: http://www.mathworks.com/matlabcentral/fileexchange/54929-embedded-coder-target-for-energia
As I understand, you are looking for MATLAB command line APIs to directly talk to TIVA board like MATLAB does with Arduino . As of now the support for TIVA is via Simulink. Doing this in MATLAB is not supported directly. This will require creating MATLAB wrapper code to work with TIVA.
Hello Peeyush,
Any update on my queries,
Well if i am not wrong,
As far as i dig out the issue,i found that the blocks under Embedder Coder for Energia are same as that of Aurdino blocks having Same configuration too,which is very unfortunate.
As both the boards have different pinout for programming.So this coder cannot support all the pins on TI boards(TIVA & MSP430). Using ADC with analog read block will give always wrong results as it is set to measure from 0-1023 as of aurdino and we have ADC as 12bit in TIVA which needs to go from 0-4095 .same is the case with PWM and other pins .
Kindly help here to sort out the issue.
Thank you.
Rather
Limitations you (properly) report and (rightfully protest) suggest a "name change" is in order - perhaps (as I've heard) - "Low/Compromised/Slight-energia" better reflects, "capability & promise?"
Hi Sajad,
Apologies for the late reply. I am addressing issues pointed by you as below:
- I do not see any issues with PWM block where you are not able to use Pin 30. You should be able to use Pin 30 for PWM. I have not restricted anything as such for the same. I cross verified this at my end and it works.
- The idea behind Energia support is to make it analogous to Arduino support and I am sure even TI follows that, Energia is basically a replica of Arduino and we have made sure that it is compatible with Arduino blocks. Ideally all examples of Arduino works same on Energia, irrespective of the hardware:
In the above link you would observe resolution for ADC as 0-1023, eventhough there are hardware with better ADC resolution at both sides Arduino and Texas Instruments.
Hello Peeyush,
Let me start from the very begining,I have attached the Energia Pinout for Tiva Below
As you can see multiplexed pins for launchpad for example the Pins Start from A0- A11 are all analog pins and similiraly you can find the pins for PWM ,UART and other functionality as well.
Using Energia to program the launchpad if we follow this Pinout Structure you can program those all pins in what configuration we want.Now as matlab has embedded coder for energia, so it should work the same way as energia but as i try to assign the pins only few work for PWM and for ADC too.
Please look into the following Attachments and the error displayed ,(As far as i can say it recognizes the TIVA LAunchpad but takes the Pinout of Aurdino Style).
Here above i try to use pin no 29 as analog pin but it displays error that you can only use 2- 13 no pins for analog read,and for tiva only few pins are having analog function on these pin nos,and rest analog functionality is on others which it doeskin take.
And in this one i am trying to configure the Pin30 which is having PWM functionality in it.But it displays error as shown in figure above.
I think the matlab S-function for these modules need to be edited as per the TIVA pinout for Energia.
Thank You
Rather Sajad
Hi Sajad,
I understand the issue you are facing. However I have taken care of this constraint for Energia, eventhough it depends on Arduino S-functions. I thought if it is overlapping with Arduino support from Simulink and thus installed Arduino support package as well. Still I am not able to reproduce the issue. Make sure you are using the latest Energia Support from file exchange.
Ideally it should throw error if Pin entered is out of 2:53 range.
Thanks,
Peeyush
Hello peteri,
Thank you for your response on my post,
The thing is i wanted to do this I2C using Matlab Simulink, it seems have to do some reading on it as its seems new to everyone.
Anyway posted my query over there too,
Regards
Rather
Hi Sajad,
As the prototype for Arduino is readily available on:
This should not be difficult to do it on Energia, as you would like to use same S functions on Energia.
The below guide can help you in order to find how to create s functions wrappers drivers for Simulink:
www.mathworks.com/.../39354-device-drivers
Let me know if you need any clarifications.
Thanks,
Peeyush