msp430 | Code for Texas Instruments MSP430 LauchPad
kandi X-RAY | msp430 Summary
kandi X-RAY | msp430 Summary
Code licensed under GPLv2 for Texas Instruments MSP430 LauchPad. Peter Senna Tschudin - peter.senna@gmail.com. If you want to learn about programming the MSP430:
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of msp430
msp430 Key Features
msp430 Examples and Code Snippets
Community Discussions
Trending Discussions on msp430
QUESTION
So I got this very strange problem that happens every time. I am trying to interface and LCD with the MSP430 module. But in this function at the middle of the loop, the variable i resets itself to 0 for no apparent reason at all, somethimes it even crashes.
This is the structure of the lcd_t struct:
ANSWER
Answered 2021-Jun-01 at 19:47WDTCTL = WDTPW + WDTHOLD; // stop watchdog timer
QUESTION
I'm relatively new to MSP430-programming and want to use the driver lib (https://www.ti.com/tool/MSPDRIVERLIB) for the MSP430FR2355. I included the library "driverlib.h"
in an new empty project with the following code:
ANSWER
Answered 2021-May-15 at 11:35I got an answer on another forum. Maybe someone else faces the same problem, so I'll post the solution here:
In Code Composer Studio go to Properties -> Processor Options and try the settings as shown in this screenshot.
Many thanks to Johnson, who provided this answer (https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1001359/mspdriverlib-error-when-using-msp430-driver-library-only-large-data-model-supported-for-this-rom)!
Best regards.
QUESTION
I am trying to send some commands to a Terminal through UART, so in order for the MSP430 to know which command he got, I wrote some if-conditions in case cREC_BUFFER contains a certain word, the microcontroller should controller it then, for example if the string cREC_BUFFER contains the word "ENDE" at the end, he should go into the if condition inside. The problem that I am facing, is that when I check what the string empty string cREC_BUFFER has after debugging, it contains only the last character "E" of the word "ENDE". Can someone tell me what mistakes I am making here? Thanks a lot for the help in advance! (I reduced the length of the code in here by deleting the content of the other functions, since they do not cause the problem)
...ANSWER
Answered 2021-May-09 at 14:35 j= 0;
cREC_BUFFER[j++]=UCA0RXBUF;
QUESTION
I am working on an embedded rust project using msp430 controllers (MSP430G2553 - LaunchPad).
I have boilerplate code up and running from the msp430 quickstart repo
However, for my project, I need to run hmac, so I found a no_std
compatible crate. I have tried roughly 10 other crates as well without luck.
I believe I need to specify some flags for the linker, but I do not know which I am missing. I currently have rust the following rustflag set in .cargo/config
:
ANSWER
Answered 2021-Mar-17 at 13:05It seems that you are linking to the wrong memory spec file.
I would recommend to ensure that this file exists link-arg=-Tlink.x
, otherwise switch it to the correct file.
Rust embedded named their memory file memory.x, and I assume have followed the steps. So changing the flag to link-arg=-Tmemory.x
should fix it.
QUESTION
I am looking at this:
...ANSWER
Answered 2021-Jan-14 at 07:47Very brief overview for GCC:
GCC's .md
machine definition files tell it what instructions are available and what they do, using similar constraint syntax to GNU C inline asm. (GCC doesn't know about machine code, only asm text, that's why it can only output a .s
for as
to assemble separately.) There are also some C functions that know about generic rules for that architecture, and I guess stuff like register names.
The GCC-internals manual has a section 6.3.9 Anatomy of a Target Back End that documents where the relevant files are in the GCC source tree.
QUESTION
i am currently working to solve the stage Hanoi in the Microcorruption CTF. This CTF focusses on the MSP430 Family (RISC, 16Bit).
I stumbled across the following lines:
...ANSWER
Answered 2020-Dec-22 at 23:14As pointed out in the coments by Peter Cordes, my initial thought is correct. (Even though the wording is off)
The value stored in the memoryaddress, which is equal to the sum of the value stored in r4 plus the offset -4 is decremented by the register plus -4 (offset) and stored in r15. That's it really.
Example:
If
r4 = 0x43FC and 0x43F8 = 0xAB
The instruction
QUESTION
[MSP430 16 bit]
...ANSWER
Answered 2020-Nov-11 at 10:41Nothing changes between signed and unsigned subtraction. What changes is what kind of jump you use: JLO or JL. JL and JGE is used for signed comparison. JLO and JHS are used for unsigned comparison. So, in your case, you are using unsigned comparison and the jlo will not jump to 0xda36 as CMP will set the carry bit. Note that JLO is an alias for JNC (jump if not carry).
To compute manually the subraction you can traslate it to the sum of the first addend plus the one complement of the second + 1. So in you case you have:
QUESTION
(MSP430 16 bit)
...ANSWER
Answered 2020-Nov-10 at 08:24It would help to take a look at the documentation.
Section 3.4.6.14 of the MSP430x2xx Family User's Guide says:
Syntax
CMP src,dst
orCMP.W src,dst
Description
The source operand is subtracted from the destination operand. […] The two operands are not affected and the result is not stored; only the status bits are affected.Status Bits
[…]
C: Set if there is a carry from the MSB of the result, reset otherwise
So the carry flag will be set if subtracting 0x200 from zero needs a carry.
This meaning of the carry flag is made clearer in the documentation of JC/JHS in section 3.4.6.24:
Description
[…] JC (jump if carry/higher or same) is used for the comparison of unsigned numbers (0 to 65536).Example
R5 is compared to 15. If the content is higher or the same, branch to LABEL.
QUESTION
Ok so I am working on some embedded code to go on a msp430 launch pad, I was trying to toggle a pin high and I ran into an issue when I began trying to use one of the macros in the header file which was also in a specific namespace in the main.cpp file. I assumed I could use the same convention as say to call a function in that namespace for call a macro? The code would not compile until I declared using namespace, instead of msp430:: like I wanted since I have 3 different namespaces in the header file. is there not a way to do this without declaring the using namespace? I can do it with variables from a namespace as well so I don't see what I could not with a simple macro def.
...ANSWER
Answered 2020-Oct-19 at 20:16No, macros don’t know about namespaces. Try to avoid macros whenever possible. Here you can probably do something like
QUESTION
I am compiling C for the MSP430. I'm wondering what the specific rules are for when sign extension is done for chars (or (u)int8_t) to the register size (16 bit) I found that sign extension will be done when the MSB of the destination operand will affect the correct result of the instruction and all succeeding instructions. However, this does not really explain it I think. For example when looking at this code:
...ANSWER
Answered 2020-Oct-15 at 14:06Let f(a, b,…) be a function of signed objects a, b,… Let a', b',… be the values of those objects reinterpreted as unsigned. If, for all values of a, b,… (in their signed types), the reinterpretation of f(a, b,…) as unsigned equals f(a', b',…), then no sign extension of a, b,… is needed when evaluating f.
This is evident because, if the condition is satisfied, then f(a', b',…) produces the bits required to represent f(a, b,…). However, it may be incomplete. We might have some f(a, b) that requires a sign extension of a but not of b, and that is not directly addressed by the above. However, it could be considered included in that f(a, b) may be expressed as a function ga(b), and then the above tells us no sign extension of b is needed when evaluating ga. If this is true for all ga, then evaluating f(a, b) does not require sign extension of b.
Also, the fact that a sign extension is not needed does not imply a compiler will necessarily detect this and generate code without sign extension. A compiler might generate sign extension even if it is not necessary. I think this may be seen in sint8fun
; I would expect (int8_t) (a+b)*2
to be evaluable as an addition and a shift without sign extension. However, the compiler may be failing to account for the fact that the expression is converted to int8_t
by the return
. By itself, (a+b)*2
does require sign extension, as it could produce a negative int
result that it would not if the signs were not extended. It is only after the conversion to int8_t
that the result is then independent of sign extension.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install msp430
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page