Jump to content


  • Content Count

  • Joined

  • Last visited

  1. Thank you so much sir, I now understand that fully, However when I am trying to read rms value by square them, sum them up, divided by number of samples to find the mean, and square root them, it is not always printing a stable number. However, if i divide the sum by (number of samples - 1) then it gives a more stable value. Do you have any suggestion on that? Really appreciated your time, and sorry for disturbing.
  2. I am trying to read the value from 50Hz sine wave and calculate its DC offset and its rms voltage. Hence, I am reading the adc value where it produced a sine wave exact as the input wave though with some deviation. I am using energia, and wanting to reproduce the signal fully. I thought I am getting 20 samples in a cycle of the 50Hz waveform which looks like it is on excel by plotting those adc results but this delay(20) seemed wrong in terms of sampling frequency theorem. I don't understand why am I doing at a wrong delay value but still getting a reproduced sine wave, and now I seemed to hav
  3. Dear Sir, Thank you so much for your time, If my signal is at 50Hz in order to not under sampling the signal, what time should I delay in this function? Since if I put delay 10, it will not be a perfect sine wave but it gives a interference of 2 sine waves, delay 1 would reach the results faster but made no difference with delay 10. If this is the case, how do I do it properly can you please give some suggestions?
  4. Thank you so much for your reply, I thought my value was wrong but it is actually correctly sampling and gives the same original signal. I am not sure how this delay(20) works, and the sampling frequency in this seemed not to be 20ms.
  5. I have a sinusoidal wave of 50Hz, this is the code that I used to read adc. for(i = 0;i<20;i++)//chosen 20 values { ADCValue = analogRead(analogInPin); delay(20); sample[i] = ADCValue;} the results were correct with sine wave display at correct value, however, the signal is at 50Hz, hence this delay(20) is at the time period of each cycle of this waveform, Why am I getting the correct adc results rather than a constant value of each time it reads at the same point? Please can someone answer, thank you so much!
  6. char final[6]; sprintf(final, "%.3f",current); Serial.println(final); When I put this code to calculate it prints only the "%.3f" I know floating point is not good to use for MSP430, but I do need the decimal places for my calculated results and need to convert to string pass on java socket. Or Can someone introduce me the fixed point calculation? many thanks!
  7. Dear Sir/Madam, I am trying to use MSP430 to talk with a wifi module using UART, technically, the msp430G2553 does not need to know the ip address for the wifi module, so the wifi module can be considered as another mcu. I have done the hardware and the calculation of voltage received and also converted to a string value. I can also read the values using hardware UART on serial monitor, but I now wants to send the results to the wifi module and check if the wifi module receives it on socket tools. My code are as below: #include <SoftwareSerial.h> // to the pins used:
  8. Hi could you share how could you do the software uart with energia?
  9. Thank you so much for your reply! I am using MSP430G2553 launch pad. When i put SoftwareSerial it says 'SoftwareSerial' does not name a type, I can print onto serial monitor normally to read the ADC value but could not transmit that from pin 1.1 TXD to my wifi module RXD pin. When the msp430 is doing print to serial monitor, does that mean the pin1 and pin 2 would have the output as well?
  10. Do you know if i want the G2553 to communicate with a wifi module can Timer serial work for pin 1.1 and pin 1.2?
  11. Hi I want to drive serial things (WiFi RN-171, BlueTooth module...) and keep serial through USB for MSP430<-> PC connection. Is there yet a way to use Hardware Serial1 or SoftwareSerial with current Energia for MSP430 ?
  12. Can you explain in a bit more details please? I have tried 'Serial 1' but it says undefined reference to `Serial1 I am not good at doing this
  13. This wifi module can be considered as another mcu, which does not need to know the IP address, but I wanted to ask how to write to the module using UART i.e. write to specific pins
  14. I understand the code about UART with the serial monitor, What should I change if I want to have TX,RX send data to TX RX on another wifi module?? Please help!!!! const int analogInPin = P1_3; //Analog input pin that the output from the current sensor is attached to int ADCValue = 0; //value read from the output void setup() { Serial.begin(9600); pinMode(analogInPin,INPUT); } void loop() { ADCValue = analogRead(analogInPin); Serial.print("ADC = " ); Serial.println(ADCValue); delay(20); // fs=1/T sampling time with approx.50Hz signal
  • Create New...