Hot answers tagged

31 votes

Realloc wasting lots of space in my MCU?

Using dynamic memory allocation on a 16 bit MCU with 4kb RAM is very poor engineering. Not so much because of the usual problems with memory leaks. Not so much because of heap memory fragmentation. ...
user avatar
  • 14.2k
18 votes
Accepted

Why do programs stop watchdog timer on MSP430?

The watchdog timer (WDT) is on by default, it's a useful thing to have in more complex applications, but trips a lot of new people up. They often will not service the WDT in their code or include an ...
user avatar
  • 11.6k
16 votes
Accepted

Getting MSP430 USB Driver Signed By Microsoft

It's not so bad, actually. I've done this a few times at work, writing and signing an .INF/.CAT for a Microchip PIC24FJ64GB002-based USB CDC-ACM-to-I2C interface. Establish a relationship with a ...
user avatar
13 votes

3 Hz from a watch crystal

You could do a 3:1 gear ratio and do the divisor at 32768. 32768 = 10,923 + 10,923 + 10,922 which indicates a state machine that first counts to 10,923 repeats and then drops a count, it would be ...
user avatar
  • 29.6k
13 votes
Accepted

I2C only works when probed or loaded with 1Mohm

I think I've found the answer. It turns out this is a known problem, but I only found that after I'd decided where the problem was, and searched for that! Here is the process I went through, so you ...
user avatar
  • 16.7k
11 votes

3 Hz from a watch crystal

Take the 32,768 Hz square wave and feed it through a 98 kHz band pass filter to leave (mainly) its 3rd harmonic - this is fairly trivial. Now you have 3 times 32,768 Hz which you can divide with the ...
user avatar
  • 385k
10 votes

Realloc wasting lots of space in my MCU?

This is called memory fragmentation. There are all kinds of fancy algorithms to deal with it, but the bookkeeping overhead makes them unsuitable for a small MCU. Instead, you can write you own ...
user avatar
  • 19.8k
9 votes

Why do programs stop watchdog timer on MSP430?

In addition to Samuel's point about people accidentally tripping the WDT, there's another important reason why it should be disabled initially. Even if your application is normally capable of ...
user avatar
  • 191
9 votes
Accepted

MSP430 RAM protection

Can anyone explain to me what a strange protection if the password(code) 5Ah is known? It protects you from random modification by runaway code, e.g. on stack overflow. Why RCKEY always read as ...
user avatar
  • 9,620
9 votes

Programming bare microcontroller chips

You can use a JTAG programming tool for this purpose. Pinout of the programmer looks like this: You can find matching pins on the IC: When you design your custom board, you can put in a row of ...
user avatar
  • 7,542
8 votes

My oscilloscope is not measuring the frequency of my wave accurately

The MSP430FR58xx, MSP430FR59xx, and MSP430FR6xx Family User's Guide says in section 3.2 that the CS module default configuration is: LFXT is selected as the oscillator source for LFXTCLK. ...
user avatar
  • 14.6k
8 votes
Accepted

UART in my code transmits a character, yet on the oscilloscope I find it gave me another signal

If you try to use 9600 bps rate with 32768 Hz clock, it is not possible, the actual baud rate will be faster, 10923 bps. That is 13% faster than requested 9600 bps, and thus out of tolerance ...
user avatar
  • 89.9k
7 votes

3 Hz from a watch crystal

It is true that 32768 Hz does not divide by 3 Hz, but it is not off by much. You need a solution which appears visually smooth and is accurate on average over time. Simply create logic which: ...
user avatar
7 votes
Accepted

Wrong load capacitance for 20 MHz, 20 pf crystal

To get the specified 20 pF load for a crystal, you need two 40 pF caps, theoretically. However, these 40 pF caps in reality do include package pin capacitance (2-3 pF each pin), plus parasitic ...
user avatar
  • 37.4k
7 votes
Accepted

Test UART send and receive without a physical device

You can do a simple "loopback" test - connect your Tx output to your RX input - if all is well, you can talk to yourself. EDIT The loopback test only shows that your transmit/receive ...
user avatar
6 votes
Accepted

MSP430 launchpad's bypass capacitor mystery!

SBWTDIO is a high frequency signal (used for programming the chip) which won't tolerate an 100nF cap. Remember that a cap in the data line results in longer signal rise and fall times. Note the ...
user avatar
  • 9,620
6 votes

How do you design a switch input to a MCU for ultra low power consumption?

Turning the internal pull-up (or in your case, pull-down) resistor off is indeed a way to minimize the power consumption when a switch remains asserted against that resistor. However, by itself that ...
user avatar
6 votes

My oscilloscope is not measuring the frequency of my wave accurately

The community's help is very much appreciated. The time-base setting (orange box added by me) is 400 us. I've also over-laid vertical red lines on your screen shot. Each red line highlights the ...
user avatar
  • 385k
5 votes
Accepted

MSP430 Timer A interrupt flags are wacko

CCR0 holds the maximum value that the timer counts up to. When the timer reaches this value it resets to zero. Only CCR0 does ...
user avatar
  • 51.4k
5 votes
Accepted

Best microcontroller for industrial applications

Which micro-controller should I use based upon performance, storage, durability, speed , architecture and robustness? To that list add availability, second sourcing, cost, remaining lifetime ...
user avatar
  • 143k
5 votes
Accepted

MSP430 Programming BSL vs Spy-Bi_Wire

Spy-Bi-Wire is: more powerful. It is an implementation of JTAG interface, so it allows not only program, but also to debug the MCU (single-step, insert breakpoints, etc). more complex. Typically ...
user avatar
  • 607
5 votes
Accepted

How to figure out reason for last reset on MSP430?

You can get the reset source from checking the system reset interrupt vector (SYSRSTIV), there is a good description on the TI wiki (Handling MSP430 System Reset Events).
user avatar
  • 1,673
5 votes
Accepted

How do microcontrollers (MSP430G2452/G2553 specifically) behave when the battery runs low?

The problem with VCC dropping uncontrolled is as follows. Erratic Behavior. Unstable Clocking. Brown-Outs. And Stalling. Or worse, corruption. Not even accounting for mismatched input voltages. From ...
user avatar
  • 71.1k
5 votes
Accepted

How do you design a switch input to a MCU for ultra low power consumption?

The internal pulldown has 20–50 kΩ, typically 30kΩ, which limits your choice of resistor to pull the input up. Fortunately, you can turn the internal pulldown resistor off, which is also the ...
user avatar
5 votes
Accepted

MSP430 microcontroller

Sounds like, due to your questions on basic hardware and software setup, that you should start with the MSP-EXP430G2 Launchpad. It's US$10 and has all the hardware you need to familiarize yourself ...
user avatar
  • 2,419
5 votes
Accepted

Code Composer Studio 6.1.0 debugger is not acting as it should

Your MSP430 is a 16-bit machine, so the compiler is doing the (10000*tnth) as a multiplication of 16-bit numbers and truncating the result to 16 bits before ...
user avatar
  • 13.3k
5 votes

MSP microcontroller Watchdog timer

Go to TI's web site and locate the main page for your MSP430 processor. (I'm not as familiar with the MSP432.) For example, here is the site for the MSP430G2553. Once there, find and get the User ...
user avatar
  • 70.3k
5 votes

My oscilloscope is not measuring the frequency of my wave accurately

Now being a little more productive than I was in my comment, and trying to solve your X problem rather than the Y problem you asked about (see XY problem), there's almost certainly an error either in ...
user avatar
  • 1,362
5 votes

My oscilloscope is not measuring the frequency of my wave accurately

Which clock path did you intend to select? These modern MCUs have a zillion options. I believe that this is the default path (in red). 32768/25 = 1310 Hz Toggling at 1310 Hz yields 655 Hz. Not ...
user avatar
  • 9,116
5 votes
Accepted

HX711 chip not working

I think in your schematic that you haven't tied AGND into proper GND: - The above is a sample circuit I found on google that clearly shows that AGND connects to a GND symbol and your circuit doesn't ...
user avatar
  • 385k

Only top scored, non community-wiki answers of a minimum length are eligible