Jump to content
43oh

alibaba

Members
  • Content Count

    9
  • Joined

  • Last visited

Reputation Activity

  1. Like
    alibaba reacted to mbeals in sensor interface with launchpad msp430 using energia   
    Okay.  So it sounds like you want to interface with a generic serial terminal (Putty, minicom, etc) and not write a custom piece of software for the computer side of things.  It also sounds like a fairly low update rate to the MSP (if the user is hand typing things in).   In this case just do the string conversion on the MSP.   You might be able to use the implementation of atoi() in stdlib...if not it is a simple enough function to write.  Then you just need some code to buffer the incoming characters.  There are lots of examples here on this forum if you look, but the basic flow is to create a global array then use the UART rx interrupt to push incoming chars into the array.  Have it watch for the line term char ('\n') and set a flag when it sees it.  Your main loop looks for the flag on every loop and if it sees it, processes the buffer as a new pressure value and clears the flag.
  2. Like
    alibaba reacted to mbeals in sensor interface with launchpad msp430 using energia   
    ASCII is a method to transmit text strings.  Each character (including numbers) has a coresponding 8 bit value.  So if you want to transmit the number 255 over uart via ASCII encoding, you send the btye string:  0x32 0x35 0x35 0x0D where 0xD is the line term char...it tells the receiving software that you are done sending chars and to process everything it just received as one blob of text.
     
    If you send the number as an ascii string, the MSP will just have a four element buffer, which the control logic can't really use.  You have to write code (usually an atoi() function ) to decompose the ascii chars back into numbers and assemble them into a single number.    What I'm suggesting is to skip the ASCII conversion all together and just send the 8bit number the control loop needs over the UART as it is.  It eliminates all the conversion code on the MSP as well as the RX buffer and processing code...saves lots of valuable ticks.   For the LCD, just convert the number to ASCII on the MSP430 for display.  As long as your refresh rate on the LCD is less than the recieve rate of the updates, you will come out on top. (comverting every 5th or every tenth number as opposed to every number).
     
    Let me ask you this.... what is sending the pressure data to the MSP430?  Is it software you wrote?
  3. Like
    alibaba reacted to mbeals in sensor interface with launchpad msp430 using energia   
    Are you planning on interfacing with the device through a terminal (like putty), or programatically (labview, python, etc).  If you don't require a user friendly CLI, you don't have to mess with ascii at all.  The serial line is just transmitting single bytes at a time.  The translation to ascii characters and line termination is just one way of interpreting that byte data.  If all you are sending the unit is an 8 bit update to the pressure, then just write that byte straight to the UART.  This also lets you update faster, as using ascii encoding, you would need 4 bytes (3 digits plus termination) to represent a single byte of data.  The only downside is that you won't have a friendly terminal to watch or interact with...although there are terminal programs (I like realTerm) that let you change to formatting and read/write in raw hex/dec/binary as well as ASCII
  4. Like
    alibaba reacted to yosh in sensor interface with launchpad msp430 using energia   
    I made a circuit of 4 load cells using a INA129. I use 3.3V as excitation voltage and power for the G2452 - no problems. You can easily adjust the (maximum) output voltage of the INA129 by choosing an appropriate trim potentiometer as the gain resistor.
    What kind of load cell are you using?
     
    Edit: Added Image.
     
     

  5. Like
    alibaba reacted to mbeals in sensor interface with launchpad msp430 using energia   
    Do you need to maintain galvanic isolation between the sensor and the launchpad?  Instead of attempting to level shift, it might be worth just adding an isolated ADC to the sensor package.  The analog side would accept the 5V supply and read 0 to 5V (assuming rail to rail) while the digital side would be powered from the launchpad's 3.3V supply.  Instead of using the ADC on the MSP430, you would read theis chip over I2C or SPI.  It's likely a simpler package (circuit-wise) and will likely have better performance than the ADC built into the MSP430.
  6. Like
    alibaba reacted to grahamf72 in sensor interface with launchpad msp430 using energia   
    There's unfortunately no generic one-size fits all answer. The answer to your first question about reading the sensor all depends on what the sensor outputs. This will determine whether or not you have to do any modification before you feed it into the 430, and will also determine whether you use an inbuilt reference voltage or external reference voltage. For example if the sensor will output 0-2v you can connect it straight up to an analog input port and use the 2v or 2.5v internal reference. But if it outputs 0-5v you will somehow need to reduce it. How you go about that will depend on the specific device. You may be able to get away with something as simple as 2 resistors as a voltage divider, or you may need an op-amp. Things that will determine which method you use include factors such as the output impedance of the sensor, the rate of change of the outputs, and the accuracy you are desiring.
     
    Now, question 2, how to output to a 7 segment display. Once again, the answer is "it depends". Will you will be driving multiple digits? Does your display use multiplexing, or does it require each segment to be driven directly? Or does the display have its own controller that uses an spi, i2c or other interface?
     
    There are many possibilities for both the sensor and the display that it is impossible to provide a generic answer. The Energia coding will be highly dependent on the hardware. The code to output to a multiplexed 4 digit display, will look nothing like the code to output to a 8 digit spi display.
     
     
    Sent from my iPad using Tapatalk
  7. Like
    alibaba reacted to dubnet in sensor interface with launchpad msp430 using energia   
    Not a genius but I may be able to help a bit.  As long as you tie the grounds between the two power supplies together then the output of the sensor will be readable by the ADC in the microcontroller.  However, you may need to condition the signal from the sensor so that it doesn't swing below ground or above the 3.3V supply of the microcontroller.  This can be accomplished with a resistor divider or an op amp circuit.  What is the full output swing of your sensor?
     
    With regard to your question on the display you may want to google something like "microcontroller interfacing with 7 segment display" or similar.  Should yield both circuits and code examples you can use.
×
×
  • Create New...