Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by Taggsladder

  1. OMG, what i major mistake. Need to revise all of my code! Thank you so much for explaining this! Best regards Andreas
  2. OK, I see.. But I am thinking like this: char a[2] = {data[9], data[10]}; a[0] = "data9" a[1] = "data10" a[2] = NULL Isn't the array always starting at 0? Best regards Andreas
  3. Thanks for your reply. Sorry I forgot to mention that I am using Energia coding or maybe it doesn't matter? Please see http://energia.nu/String.html Here it states Best regards Andreas
  4. Hello I am working on a MSP430G2553 project and a strange thing is happening when I am converting two chars to integer. If I only convert one value like this: char a[2] = {data[9], data[10]}; // Put in a array + terminating NULL byte. int i_a = (int) atoi(a); // Convert to a integer. It converts the "a" correctly to a integer, but when I do like this: char a[2] = {data[9], data[10]}; // Put in a array + terminating NULL byte. int i_a = (int) atoi(a); // Convert to a integer. char b[2] = {data[12], data[13]}; // Put in a array + terminating NULL byte. int i_b = (int) atoi(; //
  5. Really happy with this setup. Works great and fits my needs perfect. Thank you so much. And thanks everybody for your input [emoji16] Best regards, Andreas
  6. I have a base unit that has those features and is working great. This is for a addon to recognize when the ignition is turned over. So just a basic digital input to the msp430. First I thought I could go with a manual push button to GND and avoid all the problems with a positive input but as many said it is not a good manner to do so, so I just need a simple way of converting the automotive positive from the ignition to a simple digital input to the msp430. Best regards
  7. Thanks for the reply! I want the setup to be as of a good practice as possible of course. I was a little skeptical about doing it this way but I thought I could get away with it and avoid all problems connected with a positive input (spikes etc.). On the contrary what is the best/min. components, yet good pratice way to use a positive input instead? I am going to make a couple of these devices so I need to take number of components and the time it takes to solder them in to consideration. Best would be if there was a finished PCB to buy that would do the job. Maybe a step down of s
  8. OK, i know the basics of the problems with automtive systems and the msp430 ground is the same so it shouldn't be a problem as you say. Thanks!
  9. Hello I am working in a msp430 device that is going to be used in a car running of the cars battery. Everything is working fine but I need to know if it is safe to connect a digital input directly from the msp430 to the cars ground via a push button? Best regards Andreas
  10. Ok, thanks for the info! Oh, 3% is quite much. May go with an external then. Best regards Andreas Skickat fr
  11. Hello again Sorry for the delay I have used your examples and it is working, thanks! I have a question tho; what is the accuracy of the internal crystal (G2553) or where can I find it in the datasheet? Couse if I set the timer for 24 hours, it is roughly 5 min off (5 min to much at 2 times I tested it). Is this normal? Best regards Andreas Skickat fr
  12. What is the proper way of using counting variables in loops. Lets say I have 5 loops in a sketch and they all use a counting variable "i". Should this be a unique variable for all 5 loops say i1, i2, i3... or is it ok to use the same variable in all loops and just reset (i=0) it before the loop? Thanks Skickat fr
  13. Hello Please note that I am a beginner I am working on a project that needs a relay to be turned on for a preset time. I have written the following code and it works but obviously no other code can run at the same time. I have been trying to use millis() instead but with no success. Can someone give me a hint? The timer span will be 1 sec - 999 hours or 1 sec - 99 hours. I have not decided yet, will it be some problems with max to be 999 hours? The timer do not need to be very accurate. It says the millis() will overflow after about 50 days. If I use millis() somehow will this
  14. Thanks!!! Got it working now, sweet! That is exactly what i wanted! I am gonna play with a little more, sure some more questions will pop up Thanks again for your well written reply, truly appriciate it. Best regards Andreas
  15. Hello My name is Andreas and I am from Sweden, this is my first post here First of all I want to say that I am very new to microcontrollers, please bear with me. I started off by reading "MSP430 Microcontroller Basics" and then bought TI's Launchpad and read "Getting Started with the MSP430 LaunchPad". Since then I have fiddled with the Launchpad a couple of weeks doing some basic projects. Since my C coding knowledge is not very good I have been working in Energia and the "simpler" coding, not sure what it is called. I am working on a new project where I need the MSP430 to listen
  • Create New...