• Announcements

    • bluehash

      Forum Upgrade   03/11/2017

      Hello Everyone, Thanks for being patient while the forums were being fixed and upgraded. Please see details and report issues in this thread. Thanks!


  • Content count

  • Joined

  • Last visited

About Taggsladder

  • Rank
    Advanced Member

Recent Profile Visitors

79 profile views
  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 like this. foo("Normally text passed here"); // But I would like to call it like this also. foo(NULL); Looking forward to any reply. Best regards
  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() { } Have a nice day!
  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(); // Clear LCD. myScreen.setFont(0); // Set "small" font. myScreen.text(4, 2, "TEST"); // Display on LCD. } void loop() { } Tried it with the Tried with and with out this. No difference. Tried the library as is and tried changing the myScreen.begin(); function to something similiar: void LCD_5110::begin() { pinMode(_pinChipSelect, OUTPUT); pinMode(_pinReset, OUTPUT); pinMode(_pinDataCommand, OUTPUT); pinMode(_pinSerialData, OUTPUT); pinMode(_pinSerialClock, OUTPUT); pinMode(_pinBacklight, OUTPUT); pinMode(_pinPushButton, INPUT_PULLUP); delay(500); digitalWrite(_pinReset, HIGH); digitalWrite(_pinDataCommand, LOW); write(_commandLCD, 0x21); // chip is active, horizontal addressing, use extended instruction set write(_commandLCD, 0xc8); // write VOP to register: 0xC8 for 3V
  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 be able to handle 45V between collector-emitter. But I think that I can understand why Q4 fails becouse it can handle 20V max between gate-source. Am I right? Thanks Best regards, Andreas
  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 is disconnected and the voltage divider is no longer linear. Measurements without zener: 10V in, 0.9V to mcu pin 15V in, 1.35V to mcu pin 20V in, 1.78V to mcu pin Measurements with zener: 10V in, 0.9V to mcu pin 15V in, 1.25V to mcu pin 20V in, 1.46V to mcu pin Why is this so? http://www.re-innovation.co.uk/web12/index.php/en/information/electronics-information/accurate-voltage-measurement Thanks Kind regards Andreas
  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 similiar in Energia when uploading the sketch. Also tried just to put the pin high or low with other code and no problem so it is not a hardware issue i believe. "boolean backlight = false;" What am I missing here? Kind regards, Andreas
  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