Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by Taggsladder

  1. Thank you for your input. I think you are right, I looked at some other of my projects and found that I use similar code there that works. I need to dig into it
  2. Hello I don't know if this is quite the right place to post this or if my title is describing this correct and maybe this is more of a general C questions, but I hope its OK to post it here. It is on a MSP430 Launchpad anyway. The code is simplified, there is more parameters passed to the function etc. // I have a function like this. void foo (char* bar) { if (!bar) Serial.print("bar is NULL"); // I want to check when NULL is passed on but this doesn't work? // Also tried (bar == NULL) and (bar[0] == NULL)... else Serial.print("bar is not NULL"); } // Usually I call it
  3. [sOLVED] > QUICK AND DIRTY I got it working now. Not the best way but it does the job. Just a personal project so no worries. Running the initializing function two times with a delay did the trick for me. // Include LCD library. #include "LCD_5110.h" LCD_5110 myScreen; void setup() { myScreen.begin(); // Start LCD communication. delay(1000); myScreen.begin(); // Start LCD communication. myScreen.clear(); // Clear LCD. myScreen.setFont(0); // Set "small" font. myScreen.text(4, 2, "TEST"); // Display on LCD. } void loop() {
  4. Major bump I have the same problem. It works perfect except I need to reset the mcu after every powercycle or else the lcd stays completly blank. I could live with it but its just bugs the h*** out of me. Just basic sketch. In the code below I used a IO pin for powering the LCD but also tried powering from VCC with no luck. // Include LCD library. #include "LCD_5110.h" LCD_5110 myScreen; const int lcdVdd = P1_4; void setup() { pinMode(lcdVdd, OUTPUT); digitalWrite(lcdVdd, HIGH); myScreen.begin(); // Start LCD communication. myScreen.clear(); //
  5. Thanks for the reply @@enl! Ok, I understand. The reverse breakdown of D5 is 200V. D5 http://www.farnell.com/datasheets/162697.pdf Though I think that I will go with the original plan of just using a DPDT signal relay switched by a transistor, find it is easier when you know exactly whats gonna be switched. Would have been neat to use them magic FET's but clearly I have some learning todo This forum is such a great place, thanks again! Kind regards, Andreas
  6. Hello I am working on a curcuit that need to switch two loads max 200mA. One load gets feed ground and the other load gets feed positive. VCC will be in a span of 6-30VDC. The curciut works as intended when VCC is 6VDC, but at the max span VCC 30VDC all (Q1, Q2, Q4) transistors and the FET breaks when the pin from the MCU goes HIGH. This will happen even if the connector is unconnected. Q1, Q2 http://www.farnell.com/datasheets/699988.pdf Q4 http://www.farnell.com/datasheets/1885683.pdf From what stupid me can read from the datasheet Q1 and Q2 should
  7. I played around with that too but since the device will power from the cars battery I want as low consumption as possible.
  8. I was thinking about some sort of lookup table as you say Thanks for the help, much appreciated. Have a nice day! Sent from my SM-G900F using Tapatalk
  9. Thanks for the reply! TBT, just the word opamp scares me a little, hehe. How comes the zener is used in the link and the title is "Accurate Voltage Measurement". Is there a way to calculate this offset in software or would it be to messy? I am not looking for a accurate reading, +- 0.5V in a 10-25V span would do fine. Best regards
  10. Hello I want to measure the battery voltage (ballpark measurement) in a car so I thought I do that with a voltage divider connected to a msp430 ADC pin, but I wanted to add overvoltage protection with a zener as in the schematics in the link below. I am using 100k / 10k in the voltage divider and a BZX79C2V7 zener. If I leave the zener disconnected I get the divider to work as expected in a linear fashion, but when I connect the zener I get the correct reading when the input voltage is 10V but if for example I double the input voltage to 20V I get a lower reading compared to when the zener
  11. Strange. Changed computer and used a new Launchpad and it worked straight ahead. Well well. Goofed something up I used another library this time though. Don't know if it was the problem. Used this library from here instead, don't know the difference. https://github.com/pasky/Energia/tree/master/examples/7.Display/LCD_5110_430 Thanks anyway, sorry to bothering Kind regards Andreas
  12. Hello Cannot get the Nokia 5110 LCD to work with my launchpad and the G2553. First thing I noticed is that when the library example sketch (LCD_5110_main.ino) is uploaded and the LCD is disconnected the backlight pin is floating. Also there is nothing happening when pushing the Launchpad push button 2 that should enable/disable the backlight. I am using this library: https://github.com/energia/Energia/tree/master/examples/07.Display/LCD_5110 As I said with the example sketch uploaded the backlight pin (P2.1) is floating with the line below either true or false. No errors or simili
  13. Thanks! Sound good. Also found this https://www.sparkfun.com/products/12009 that looks quite nice. I will play around and see whats works best for my project. Have a nice day Best regards Andreas
  14. Hello guys and gals Another newbie question I have a device that I want to communicate with over UART using the good old MSP430G2553. The device will have a supply voltage of about 4V and has an absolute max voltage rating of 3.1V on any input pin including the UART, typical 2.8V. Min. 2.4V for HIGH. First of all, from what I can read from the datasheet the MSP430 will have a UART logic high of Vcc - 0.3V and I am thinking that since the MSP430 supply voltage range is 1.8-3.6V, would it be "good practice" just to power the MSP430 with let's say 2.8V and thus have compatible UA
  15. Thanks for the reply! Have a great day. Kind regards Andreas
  16. Hello I have a large sketch with lots of quite long Serial.print() and I have read somewhere about Arduino that to save SRAM you can use the F() macro like "Serial.print(F("lala"))". But When I try to use this in Energia I get no errors but the Serial.print don't display anything. Why is this? Thanks! Best regards Andreas
  17. Thanks guys! I ordered lm61, ds18b20 and the tmp100. Will play with them and see what suits my needs best. Have a nice day! Best regards, Andreas
  18. Hello friends Hope you are all doing great! I need advice on an external temperature sensor for a MSP430G2553 project. I just need to read the "outside" temperature like a span of -30 to +80 celcius. I "just" ([emoji16]) want to know what the best/easiest/most common sensor would be. Of course I am a quite a newbie to this. I have looked at some sensor like the lm35 but I read somewhere that it couldn't run at mcu voltage. Also looked at DS18B20 but its just a jungle for me and I don't know what to look for. Requirements (not any particular order): Low price Can run at mcu vo
  19. Thanks for everybodys input! Since it is working perfect and errorfree now I will stay with my setup until I have to move up if I need to incorporate new functions. Thanks again, really appreciate it! This is a great forum with nice people. Best regards Andreas
  20. Thanks for your reply! I looked at the map file and I was overwhelmed with data, didn't get much of that I have quite a lot of nested function calls but not deeper than function A calling function B. Do I understand it right that all the global vars is allocated in the RAM from the beginning and the local vars is allocated when calling the function and reset when the function exits? So the remaing 218 bytes you estimated needs to be allocated by one function bigger that 218B to run out of RAM? I don't use any malloc or new. The most of the code is just very basic code, IF stat
  21. Hello again Sorry for the delay in replying. I truly appreciate the help you guys give I have tried a bunch of things and I got it working now but I kept the original code and change the other part of the code a little that was giving me crashes. I download Ti's CCS and tried to debug with it but I didn't work it out how to do it. It did give me about 50 compile warnings (nothing major) that Energia didn't say anything about though. They are all fixed now. The code now works as intended and I have really tested it hard without any issues but it would be interesting to know what co
  22. Hello friends I see that this thread has spiraled out of what I could ever learn by the stretch of the imagination But I still have the problems when I convert char to integer. This part of the code works as intended and the original problem is solved by increasing the arraysize, but now the MCU crashes and reboots on a remote part of the code not even touching this side of the code! This is the actual code // Put on onftime hours/minutes in a array + terminating NULL byte. char onfTimerH[3] = {data[9], data[10]}; char onfTimerM[3] = {data
  23. Hello First of all I am a newbie And I am working on a project and I was wondering if it is possible to combine a string with a variable to clean up the code a little, something like this: char phoneNumber[ ] = "123456789"; Serial.print("AT+CMGS=\"" + phoneNumber + "\""); This gives an error on compiling. Looking forward to any replies, thanks! Best regards Andreas
  • Create New...