When using MSP430x41x devices, it should be noted that there are significant differences between the x413, x417 and x419 devices.
For SVS, 413 and 419 are typical examples. 413 only has 1.9V voltage monitoring. Not only is the voltage value not selectable, but it can only measure the voltage from VCC. 419 not only has SVSIN to monitor external voltage, rather than being limited to the internal voltage of VCC, but also has 14 different voltages to choose from, which can monitor internal or external voltages at will.
If you want to use 413 to indicate low battery, it will not alarm unless it is 1.9V, so it is not suitable for devices powered by lithium batteries, and is only suitable for devices using disposable dry batteries. If you want to use lithium battery indication, either do not use 413 or use a comparator.
2. Misunderstandings:
When using SVS on 41x devices, many people may misread the manual or use it without reading it carefully, resulting in software writing errors. Although these will not cause major problems, they are indeed problems that should not occur.
VLDx sets the voltage value, 0 is to turn off SVS, 1-15 are all enabled, 15 is to monitor the external signal input from SVSIN, 1-14 are from small to large to monitor the internal VCC voltage from low to high. On the 413 device, since there is only one 1.9V gear, the effect is the same as long as it is not 0. Of course, if you want to be compatible with the software of the entire 41x series, you should still use the corresponding voltage value option, that is, 1.
SVSON is the most easily misused bit. Many examples on the Internet will write code similar to the following when setting SVSCTL:
#define VLD_3V7 0xe0
void low_bat_test(void)
{
SVSCTL = SVSON + VLD_3V7;
_NOP();
_NOP();
_NOP();
if(SVSCTL & SVSOP)
//Low voltage indication
else
// Turn off the low voltage indication
SVSCTL = 0;
}
This is actually a misunderstanding. The English manual specifically notes in capital letters that the SVSON bit is not used to turn on SVS. This bit is automatically turned on when VLDx>0, so it is obvious from the above example that the author of the code thought it was a switch to turn on SVS.
The correct way to write it is SVSCTL = VLD_3V7; and then when we check the value of SVSCTL, it becomes 0xe4.
Another thing that I missed without reading carefully is about delay. Although the manual says that SVSON is automatically set when VLDx>0, if you read that chapter carefully, you will know two other things:
1. When starting (from off to on) or changing the monitoring voltage, the SVS module cannot start working immediately and must wait for a while. The waiting time for starting and changing the voltage is also different, which is about 50us and less than 12us respectively.
2. The SVSON bit does not act immediately after setting VLDx to a non-zero value. It can be used as an indicator of the stability of the SVS system. Before the SVS module is ready, the SVSON bit is still 0. When SVSON is 1, it means that the module is ready and can work.
So we can change the above program into this:
#define VLD_3V7 0xe0
void low_bat_test(void)
{
SVSCTL = VLD_3V7; //This sentence directly sets the voltage value and does not modify the SVSON bit
while((SVSCTL & SVSON) != SVSON); //This sentence is to wait infinitely until SVSON is 1 before continuing
if(SVSCTL & SVSOP)
//Low voltage indication
else
// Turn off the low voltage indication
SVSCTL = 0;
}
Did you notice the difference between the code and the previous one? I am just throwing out some ideas to stimulate discussion. If I have made any mistakes, please point them out. Let’s learn and improve together.
Previous article:How to improve MSP430 C language programming efficiency
Next article:MSP430 timer interrupt usage summary
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
- What is the difference between low inertia and high inertia of servo motors?
- Detailed circuit diagrams of regulated power supplies, DC-DC power supplies, switching power supplies, etc.
- Can the op amp be powered from a single supply?
- The embodiment of advanced usage of C language in application
- High-performance lossless data compression IP based on LZO
- MSP340F149 card number reading reference routine
- Use CCS to connect to a running C2000 chip
- Answer questions to win prizes | TI Industrial Essentials selection, exquisite content, worth reading!
- A request for help from a newbie
- Wind speed and light irradiance synchronous tester based on MSP430
- USB Development Encyclopedia (4th Edition)