-
Notifications
You must be signed in to change notification settings - Fork 0
/
general_notes.txt
71 lines (48 loc) · 3.12 KB
/
general_notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Flash - program memory
SRAM - volatile data memory
EEPROM - non-volatile data memory
XOR (^) is used extensively in C programs for microcontrollers to toggle a specific bit. NOT (~) cannot be used to invert only specific bits in the number. When a bit is XORed with a 0, it does not change. When a bit is XORed with a 1, it is inverted.
The data bus is typically 8-, 16-, or 32-bits wide. You will often hear microcontrollers described as 8-bit, 16-bit, or 32-bit devices. This is a description of how wide the data bus is on the microcontroller and how many bits the Arithmetic Logic Unit can process at one time.
float - Approximately 7 digits of precision. double - Approximately 15 digits of precision.
Do not use float/double variables unless absolutely necessary. While they are comparable in size to the other variables types, float variables are much more difficult for your microcontroller to manipulate. If you use even one float operation (like addition), your program may grow by several kilobytes.
Use a smaller variable type to hold smaller values.
CCS will default char (without a further designation of signed or unsigned) to unsigned char variables (stores 0 to 255).
CCS will default int (without a further designation of signed or unsigned) to signed int variables (stores -32,768 to +32,767).
In a signed char 127 + 1 = -128 and -128 - 1 = 127
++a Pre-increment the variable a before it is used in your instruction
a++ Post-increment the variable a after it is used in your instruction
x = ++a; a = a + 1;
x = a;
x = a++; x = a;
a = a + 1;
--a Pre-decrement
a-- Post-decrement
A good way to remember the difference between pre- and post- is that if the notation comes before the variable, it will be incremented/decremented before anything else in the instruction. If the notation comes after the variable, it will increment/decrement after the rest of the instruction has evaluated.
MSP430G2553 doesn't have a Power Management Module (PMM). There isn't a Port I/O Control by a Power Mode Control Register (Like MSP430FR6989 PM5CTL0 - Power Mode 5 Control Register 0).
ACLK: Auxiliary clock selectable for individual peripheral modules.
MCLK: Master clock used by the CPU and system.
SMCLK: Sub-main clock selectable for individual peripheral modules.
The internal very-low-power low-frequency oscillator (VLO) provides a typical frequency of 12 kHz without requiring a crystal. VLOCLK source is selected by setting LFXT1Sx = 10 when XTS = 0.
XTS - BCSCTL1 Bit 6 (0) - LFXT1 mode select:
0 Low-frequency mode
1 High-frequency mode
LFXT1Sx - BCSCTL3 Bits 5-4 (00) - Low-frequency clock select and LFXT1 range select. These bits select between LFXT1 and VLO when XTS = 0:
00 32768-Hz crystal on LFXT1
01 Reserved
10 VLOCLK
11 Digital external clock source
DIVAx - BCSCTL1 Bits 5-4 (00) - Divider for ACLK:
00 /1
01 /2
10 /4
11 /8
MSP430G2x53 Recommended Operating Conditions
Typical Vcc: 3.3 V
Vcc Max Supply voltage: 3.6 V
Max Fsystem: 16MHz
signed char __int8_t
unsigned char __uint8_t
int __int16_t
unsigned int __uint16_t
long __int32_t
unsigned long __uint32_t