Jump to content

KJH

Members
  • Content Count

    4
  • Joined

  • Last visited

About KJH

  • Rank
    Noob Class

Profile Information

  • Location
    Akron, OH
  • Interests
    entrepreneurship, engineering, aviation
  1. I did not even consider internal pull-up resistors. I have since killed my launchpad (mismanagement of a 12V wire) and have not resurrected it yet (replaced the TUSB3410 but still receive the "cannot connect to target" error). A new one is one the way and I will make sure the internal pull ups are disabled when I try next.
  2. Still new to embedded programming and I am trying to use the MMA8452 accelerometer (datasheet) on SparkFun's breakout board (link). I programmed SparkFun's example program (link) into the MSP430G2553 via Energia with no issues and plotted the serial data in Excel. However this data, for lack of a better word, was "noisy." There would be huge spikes in the data even though the device was sitting still. Sometimes the WHO_AM_I value would be reported incorrectly as well. I found out the board shipped with 10k pull ups so I dropped them to the recommended 4.7k? resistors and the problem persisted. When I tried to investigate the SCL and SDA lines with my oscilloscope, the problem would disappear and the data would be a pristine flat line (as expected). That told me the scope probe capacitance was actually helping the circuit and rather than decrease resistance I should increase resistance. That seemed very counter intuitive to me, but I followed the data and changed pull ups to 15k. The problem disappeared and the data was clean. I was using short leads with and without a breadboard. The jumper to the Green LED was also removed from the SCL line. Being required to have 15k pull ups on the I2C bus seems wrong to me especially since the datasheet recommends 4.7k. Am I missing something? I am not well versed in I2C and Freescale's tech support has been less than helpful. I did order a MMA8451 sample and swapped it on SparkFun's breakout board and had the same problem. So I know the problem was not specific to that MMA8452. Other I2C devices (like the BQ32000) work fine.
  3. KJH

    [SOLVED] PWM Frequency in Energia

    Thanks for the help! That was the issue. Now that I think about things the spikes makes sense the way I wrote the code. Every loop that analogWrite would be called which was causing the spikes. Thanks again! Working code is below for completeness. void setup() { // set the frequency: analogFrequency(800); //PWM (Pin, Duty Cycle) - Maximum = 100% = 255 analogWrite(GREEN_LED, 127); } void loop() { //Nothing in the loop }
  4. Hello! I am new to embedded programming and the forums. For my first task I am trying to generate a clean square wave with a configurable frequency and I figured PWM would be a good way to do this. Below is my code. This works to an extent, but during the off time there are regular spikes to 3.6V at about 10kHz as seen in my scope plot. The scope is a cheap Rigol DS1102. How can I eliminate these spikes? and is my approach the best approach or is there a better one that may not have the extra spikes? thanks in advance for the help! void setup() { // declare pin 14 to be an output: pinMode(GREEN_LED, OUTPUT); } void loop() { // set the frequency: analogFrequency(800); //PWM (Pin, Duty Cycle) - Maximum = 100% = 255 analogWrite(GREEN_LED, 127); } MSP-EXP430G2 w/ crystal populated to pins XIN/XOUT MSP430G2553 Energia 11 Windows 8.1 x64
×