Jump to content
43oh

thomasss

Members
  • Content Count

    14
  • Joined

  • Last visited

Everything posted by thomasss

  1. Alright, This works better: #include "msp430.h" #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <QmathLib.h> _q12 _Q12div(_q12 A,_q12 ; _q12 X = _Q12(1.0); _q12 Y = _Q12(7.0); _q12 alpha; int main(void) { alpha = _Q12div(X ,Y); return alpha; } That would be nice to have a small code like this for other functions though. Please post if you have been using other ones. Thanks
  2. Guys, Please help !!! This Qmath library is Aweful !! why is nothing working? I mean, they have a crazy example Signal_FFT but how is this supposed to help me understand the basic functions? Why don't they have a quick example to show how each function is working? I am trying to just do a division: (how can this be so damn hard to do a DIVISION!) ( Don't get me wrong, I am really glad they come up with this Qmath library, Thank TI, But please make it easier to understand) Here is the code I tried: #include "msp430.h" #include <stdio.h> #include <stdlib.h> #includ
  3. Hi everyone, Let me follow up with my results: (I finally got the time to write this post) First let me thanks everyone who has been helping in the previous messages and particularly enl for the very detailed last two msg. I finally decided to use a table with 1024 values (or every values of the ADC) (my code size was no more than 2782 bytes so I was fine with this) (I understand you can go to better accuracy but I was trying to make the all thing work before going into improving accuracy) Also I am using a MCP4822 (DAC) which have 12bit resolution. The sine and cosine were cen
  4. Alright I like the idea of the look up table. You think the table may be too big to fit into the 16k of memory of the msp430 ? I will have to do more testing on my input signals to see if they may vary in scale. If they don't vary too much I can generate my table on excel or something and input this into the msp430. Is the look up operation time intensive or is it a fairly quick operation ?
  5. grahamf72, I looked at the library code that you uploaded on http://forum.43oh.com/topic/4291-energia-library-fixed-point-math/ Do you think it will compile on CCS ? And would you have a code example by any chance to explain how you use the code ? In fix16_trig.c the first line is #include <limits.h> but I can't find the limit.h file in the zip Right now my code looks like this: unsigned int getPosition() { theta = adcValues[0] + adcValues[1]; return theta } I get the two values from the adc and I just added them to test that the adcs to dac transfer was g
  6. Thank you grahamf72, 1/65536 resolution is plenty for what I need I think. enl, thanks for the input. I am trying to recover the angle on the 4 quads yep. What other ways are you talking about ? I think if I get the angle on -Pi/2...Pi/2 I think I can just do: For Va < 0 and Vb < 0, subtract 180
  7. Hi Everyone, Thanks all of you for your help. I didn't know about Energia but will look into it. Is it better than CCS ? So if I understand well libfixmath is approximate math functions that only requires integers. Let's say I have the calculus atan(0.5)=~0.463 648 then you could find a function that do "atan"(500 000)=463 648. am I right ? Actually I have 2 ADC inputs (Va, Vb) and one DAC outputs (Vc) and I want to do Vc=Arctan(Va/Vb). Right now I only have a 10 bit adc so the resolution is limited to that. However the sensor has an accuracy of 0.0001. My future plan will be t
  8. Hi Everyone, I have been looking for about an hour online and haven't been able to find the answers to these questions. - Can I use floating point with the msp4302553 ? the watch expression on CCS don't seems to like floating point for sure. - Can I use math.h to do trigonometry calculus on the msp430g2553 ? Let me tell you guys what I am trying to do so that it is more clear: I am scanning a signal with an ADC. I would like to do an atan() on the signal and output the signal with an DAC. Right now I can scan the signal and send it to the DAC. This works well. But I can't get the t
  9. That's awesome! Thanks a lot robG! I am going to try this code as soon as I can. Thomas
  10. Hi guys, Thanks for your last replies. One more question about feasibility. How long don't you think it should take to do this for: - someone who knows the msp430 really well ? - A senor in undergrad study of computing ? - A graduate student with average knowledge in computing ? I need to know how long this is going to take me or I will try to get someone to do this. Thomas
  11. Hi guys, I know thats not going by the DAC would give us a better resolution in our sensors but our project is sponsored by NI and they want us to make a system they we could entirely connect to the myDAQ. Moreover I like the idea of using ADC-msp430-DAC because we would create a sensor that anyone could use later by just connecting it to their project. That's the main reason I want to go more on getting the signal out by the DAC. I don't know if I could use a Digital output of the myDAQ to do something like serial communication. That may be a way to explore.
  12. Hi guys, Thanks a lot for your help, that's awesome! I was actually wondering if I could get a better resolution for the ADC. If you guys say that I can use the F2013 which has a 16bit DAC, it's perfect. RobG, I would love that you help me getting a better DAC. Do you think I could even find one that can go up to 16bits ? touch, I didn't really understand the story of the CD4066. What do you mean by multiplex-scan the analog signal ? Sorry if I am not that familiar with this vocably. So up to now I have been working on getting more familiar with the launchpad. Here is wh
  13. Hi RobG, The output would represent the angular position of the axis. The relation between the angular position of the axis and the voltage output would be linear. 3.6V would represent a 360degree position, 1.8V would represent a 180degree position,... There is 2 reasons why I want to convert back the signal to analog. The first reason is that it would make an angular position sensor easy to use because the output voltage would be a linear function of the angular position. The second reason is that we want to control our system with Labview after and we are using a myDAQ which as only 2 a
  14. Hi everyone, I am working on a project for a robotic class and I am trying to convert 2 analog signals into 1. I was thinking about using the msp430 to do this but I am a mechanical guy so I am having a hard time. Let's say I am acquiring the 2 signals with 2 ADC channels, I do the operation on the 2 signals and output the result signal with the DAC. Do you guys think it's a good idea ? My problem is also the accuracy of the resulting signal. The ADC is 10 or 12 bits as I have read and the DAC is only 8 bits. Is there an easy way of adding a better DAC to the msp430 ? Here, I detai
×
×
  • Create New...