Jump to content
43oh

curtis63

Members
  • Content Count

    54
  • Joined

  • Last visited

About curtis63

  • Rank
    Level 1

Profile Information

  • Gender
    Male
  • Location
    Utah, USA

Recent Profile Visitors

1,388 profile views
  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
×
×
  • Create New...