Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by curtis63

  1. Excellent!! Thank you for that.
  2. I need to have a very accurate PWM frequency generated with my MSP430G2553IRHB32R. I'm shooting for 25.1khz. However, when running on different boards, I can see variances of up to 3khz in the frequency. I understand this is due to the slight inaccuracy in the processor's internal clock. So, I would like to attach an external crystal or oscillator to it but don't know how. I've read a couple places that say that this chip doesn't support a crystal, but that I could use an oscillator. The questions I have is how does one connect the oscillator, and what code changes are necessary to t
  3. I'm working on a project where I need to oscillate at 25khz. I've been using the PWM built into the MSP430G2553 and it doesn't seem to be accurate enough to give me exactly 25khz. I've been getting anywhere from 23khz to 27khz and cannot figure out why it's off by so much. I might be doing something wrong. Does anybody know what sort of accuracy I should expect from the on board PWM in the MSP430G2553. Is there a way to make it more accurate? I was looking at adding an external crystal, but would rather not add that complication if it isn't necessary.
  4. Does Energia have a function call to check the value, or does this involve reading a register somewhere? I'm a windows developer, not a micro-controller developer (that's why I'm using Energia) :-) Thanks for your patience with me.
  5. I'd like to monitor power and indicate to the user of my device when power is getting low (via flashing LED). Does MSP430G2553 support power monitoring and does the Energia library have any tools to access this monitoring?
  6. Seems to me that I2C is a fairly commonly used way to communicate between MSP430G2553 and various sensors. However, I cannot seem to find a standard library that implements it. There are many home spun implementations and there doesn't seem to be a standard I2C Library. I'm VERY NEW to the embedded development world, but have been a windows programmer for 20 years. I'm used to having standard reusable libraries that do the grunt work for me so I don't have to re-invent something that has been done by others 100 times already... Am I just missing something or are all embedded developers
  7. I'm writing my own i2c library and need to be able to simultaneously change PinMode on 2 pins. One for SCL and one for SDA. Is there a way to change PinMode on 2 pins simultaneously? I want the behavior of the follwing: PinMode(14,OUTPUT); PinMode(15,INPUT); without the 2.5microsecond delay between the 2 calls above.
  8. Thanks to all who have offered advice and perspective to this discussion. I have attempted my implementation using energia, but I run into bizzare behavior that I cannot figure out. For example. When using i2c, everything seems to be working just fine. I'm talking to a sensor, reading out of its fifo, getting data perfectly, then, after right around 32 seconds (no matter how long I delay between reading out of the fifo) the data gets garbled. There are 5 byte values I need to read and combine to convert it into data and they seem to just get off by some random number of bytes. So the dat
  9. Good Morning, This may be the wrong place to ask this question. If so, please let me know where to ask it.. I've been a Windows programmer for 20 years. I've pretty much stuck to User Interface development the whole time. I have been using .net and C# for the past 10 years so I am VERY SPOILED when it comes to letting the language do the grunt work and I finesse the code. I now find myself working on a personal project which requires me to program the MSP430G2553 controller. I started out by using Energia (which if you don't know, is a fork off of Arduino) The advantage of it
  10. I'm attempting to get as close to an OpenCollector PIN as I can with the MSP430G2553 Launchpad and a sensor. SCL is P1.6 and SDA is P1.7. I digital write both pins LOW and then set the PinMode on both to INPUT which should allow both pins to float HIGH. I have a 4.7K pullup resistor on each pin connecting it to 3.55v (HIGH). Is my code wrong, or is the sensor that I'm using pulling the line low? The sensor says it operates at a max of 3.7 volts. I'm using the Launchpad which measures 3.55v. Am I overloading the sensor and causing it to pull SDA to low? #define SDA P1_7 #define
  11. So, I googled Wire.setModule() and got just about bupcuss.. IE: Nada... Can somebody explain the different modules and what each of them do? I use setModule(0) so that I can use pins 1.6 and 1.7 for my SCL and SDA respectively. And that's just because somebody recommended it in a posting somewhere. I have no idea what the possible modes are or what the differences are between them...
  12. So I have frustration with Wire.h because I was having weird behavior with one of my sensors. For about 32 seconds, I would get perfect data from it, and then after 32 seconds, my data would turn to crap. It didn't matter if I read the data often, or at 10 second intervals, it still crapped out at 32 seconds. I was reading 5 bytes and doing some math on them to get the actual values. These bytes seemed to be getting 'off' by a byte or two, so the data turned to junk. I wasn't sure why this was happening. Then, I looked closely at the I2C on a scope and discovered that Wire.h was sending
  13. Yes, I do have external pullups on the SCL and SDA lines. I'm using 4.7k resistors. As to Liviu's response, I saw similar response on a different forum and here's the way I now understand it. If i call: digitalWrite(SDA, LOW); that simply sets a value somewhere that will be used on SDA when it is in OUTPUT mode. When I call: pinMode(SDA, INPUT); it sets SDA pin to OpenCollector mode which will allow other sensors to pull it LOW, or release it and allow the pullup resister to pull it up to HIGH. When I call: pinMode(SDA, OUTPUT); it sets SDA pin to whatever I set it to with my
  14. So, I'm using Energia and getting frustrated with Wire.h. I need to do some i2c communications and figured it would be fairly easy to write my own Bit-Bang implementation of i2c. I got started and things seem to be working pretty well. However, I discovered the concept of OpenCollector. It seems that OpenCollector means that the pin is set to High by default with a Pullup Resister and you just set it to LOW and then it goes back to high when you're not setting it to LOW. It also goes to low when a slave i2c device sets it to LOW. Question is how the heck do we do this with Ene
  15. /* ************************************************************************ * pins_energia.h * * Energia core files for MSP430 * Copyright
  16. It is times like this when I want to just bang my head against the wall about 3000 times... THANK YOU THANK YOU THANK YOU !!!!!!!!!!!!!!!!!!!!!!!!! THANK YOU THANK YOU THANK YOU !!!!!!!!!!!!!!!!!!!!!!!!! THANK YOU THANK YOU THANK YOU !!!!!!!!!!!!!!!!!!!!!!!!! THANK YOU THANK YOU THANK YOU !!!!!!!!!!!!!!!!!!!!!!!!! THANK YOU THANK YOU THANK YOU !!!!!!!!!!!!!!!!!!!!!!!!! THANK YOU THANK YOU THANK YOU !!!!!!!!!!!!!!!!!!!!!!!!! THANK YOU THANK YOU THANK YOU !!!!!!!!!!!!!!!!!!!!!!!!! THANK YOU THANK YOU THANK YOU !!!!!!!!!!!!!!!!!!!!!!!!! THANK YOU THANK YOU THANK YOU !!!!!!!!!!!!!!!!!!
  17. So, I've read the threads and have made things work once, but now, without seeming to have changed anything, I'm getting code that goes into never-never land.. In twi.c, around line 607 in Energia version 17, I get a lockup in the first while statement: #if defined(__MSP430_HAS_USCI__) || defined(__MSP430_HAS_USCI_B0__) || defined(__MSP430_HAS_USCI_B1__) /* Ensure stop/start condition got sent before we exit. */ if(sendStop) { while (UCBxCTL1 & UCTXSTP); // end with stop condition } else { while (UCBxCTL1 & UCTXSTT); // end with (re)start condition } #endif I've been
  18. So, is there some repository somewhere that contains more pins_energia.h files for the various flavors of the MSP430G2553 chip? I'm using the MSP430G2553IRHB32R and am suspicious that my attempt and creating an accurate pins_energia.h file for it have failed miserably.. Just wondering, before I put hours of effort into it, if somebody has already created a pins_energia.h file for the MSP430G2553IRHB32R. Thanks, Curtis
  19. Ok, so I've changed over to an MSP430G2553IRHB32R Controller. This is in the QFN 32 pin package. According to it, P1.6 is for SCL I2C and P1.7 is for SDA I2C. On the 20 pin board, they are pins 14 and 15. On the 28 pin board they are pins 22 and 23. On the 32 pin board they are pins 21 and 22. So, I'm trying to use the simple I2C Scanner and get nothing. I have 2 I2C devices attached, but cannot see either of them. There have been many posts about inserting a Wire.write(1); command and copying updated files into the system. I'm using the latest Energia 18 on a Windows 10 ma
  20. So, has anybody actually implemented ToneAC for Energia? If so, please share and let me know where I might find it. I'm currently using a BitBang and having some unwanted harmonics appear which are causing me grief. So, let me know if ToneAC exists yet. If not, let me know that too.
  21. Ok, so I figured it out. The problem was C16 !!! For production, you want a 2200 pF capacitor between RST and Ground. This makes it impossible for the chip to be reprogrammed (unless disconnected). So, for development, REMOVE this capacitor. RST on the chip should NOT be connected to ANYTHING except for the programming board. My problem was that I had RST connected to Ground through a 2200pF capacitor. This made it so Energia did not recognize the chip for programming... And it gave me the following output when I attempted to upload to my device: MSP430_GetNumberOfUsbIfs M
  22. //32 pins /* ************************************************************************ * pins_energia.h * * Energia core files for MSP430 * Copyright
  23. //28 Pins /* ************************************************************************ * pins_energia.h * * Energia core files for MSP430 * Copyright
  24. I am using a Launchpad 430 to program a custom board that uses an MSP430G2553IRHB32R chip from TI. I am doing this on a Windows 10 machine. Anyway, I have 2 problems. 1. I cannot upload my program onto the custom board because I get a 'Could not find device (or device not supported) (error=4)' error. 2. The MSP430G2553IRHB32R has 32 pins on it and the Launchpad has 20. I need to use all 32 pins. So, is there a tutorial somewhere that explains how to make alterations to energia to allow it to support custom boards and other chip pinouts? How do I get my new board to appear in
  25. I'm trying to use a Launchpad 430 to program a board that has an MSP430G2553IRHB32R. I am doing this on a Windows 10 machine. I've removed the jumpers on the Launchpad and connected VCC and Ground to the other board. I've also connected RST and TEST pins. I created a simple blinky sketch which runs just fine with a stand alone Launchpad 430. However, when I attempt to program my custom board with the same code, I get the following error. MSP430_GetNumberOfUsbIfs MSP430_GetNameOfUsbIf Found FET: HID0003:COM5 MSP430_Initialize: HID0003:COM5 Firmware version is 20409001 MSP430_VCC: 30
  • Create New...