@CL. Thank you for your guidance, that was really fruitful. I used the __no_init and logged the last function that it was in Before the Reset, however I couldn't conclude with this, so i created an ARRAY using __no_init and logged last 200 functions/places it had been before the RESET...
Reset line is already pulled-up by external resistor, there is no need to pull it up with internal resistor. Reset pin also is not a GPIO (port) pin, so you basically can't enable internal pull-up for it. As for P1.3 button: some Launchpad board revisions have external pull-up resistor soldered...
Here is my implementation of __getzone(). So now my system time base will be UTC. When the user configures my system I ask them what their local time if the time source is NOT providing UTC. Then when they supply a time sync to my system, the time they supply...
You have incorrect syntax. Please see the following line: unsigned int rand(); { This line should read: unsigned int rand() { Edit In your test code, you have the following: int interrupt(TIMERA1_VECTOR) blink_LED (void) { I have never seen an interrupt service routine defined in this way. Instead it should...
Yes. When you configure the pin as GPIO input it is high-Z, i.e. it is tri stated. That's perfect for an input pin, your external hardware will define the level. When you enable the RXEN you get a resistor that is a pull up or down. This depends on the...
What you have here is a common-cathode display. To display a number on it, you will need to multiplex the digits: set up a timer interrupt to fire at about 250 Hz to sequentially display one of the digits. That is, to display the number "1234", your display should cycle...
Yes, you can write data into the flash memory. The only problem arises when you want to change the data. You can only erase sectors, which have a size of 512 bytes. So you could take two flash sectors from the flash and store data for 10 devices in each...
__program_start: is defined in cstartup.s43. This file can be copied into your project directory and included in your project which overrides the library version. Immediately after __program_start: label the stack pointer is initialized, __low_level_init() is called, and then ?cstart_call_main is called. Around the ?cstart_call_main: label (line 339) is the following:...
c,embedded,printf,msp430,contiki
I had a similar-ish problem with the printf function just being far too big for the MSP variant that I was using so I had to write my own version of the printf function as I did not need all of the baggage associated with the format string converters. I...
The registers for the MSP430 processors are defined in standard headers and can then just be accessed as variables, they are just memory locations after all. There is a gotcha with the TAR and TBR registers in that they can sometimes return an intermediate value if they are in the...
embedded,msp430,memory-mapping
P1OUT |= 0x80000000000; This does not work because you did not count bits correctly: P1OUT |= 0x10000000000000000; P1OUT is an 8-bit register, so the compiler would throw away all but the lowest eight bits. You would have to use a data type that is large enough (and the bit you...
Clang is intended to be GCC compatible. TI's header files (msp430-gcc-support-files) use the following mechanism to define memory-mapped register variables: #define sfrw_(x,x_) extern volatile unsigned int x asm(#x_) #define sfrw(x,x_) sfrw_(x,x_) #define ADC12IFG_ 0x070A /* ADC12+ Interrupt Flag */ sfrw(ADC12IFG, ADC12IFG_); (This does not require a linker command file.)...
From the MSP430 Optimizing C/C++ Compiler v 4.4 User's Guide it appears you can achieve this is one of three ways: Using GCC __attribute__ syntax: #define TIMER_A0 20 volatile int tick = 0 ; __attribute__((interrupt(TIMER_A0))) void tick_isr() { tick++ ; } Using __interrupt + #pragma vector: #define TIMER_A0 20 volatile...
c,cpu-architecture,msp430,contiki
Make sure you build the library for the same architecture you build your program. For example, if you want to use build an executable for sky motes (MSP430F1611 MCU), build the library with: msp430-gcc -mmcu=msp430f1611 -c hello.c -o hello.o msp430-ar -cvq libhello.a hello.o Then add the path to the library...
c,pointers,msp430,iar,null-pointer
Not only writing and reading the address 0x0 will not cause a crash or a reboot, it actually a completely legal operation that is often used by MSP430 applications. The initial portion or MSP430 memory map is reserved for I/O ports and control registers: http://en.wikipedia.org/wiki/TI_MSP430#MSP430_address_space In particular, the control registers...
floating-point,rounding,msp430
Conversion by bit operations is straightforward, and is demonstrated by the C code below. Based on the comment about the data types on the MSP430, the code assumes that int comprises 16 bits, and long 32 bits. We need a means of transferring the bit pattern of the float to...
Use switch (selected_cmd) { case 0: // set light level DALI_MsgBuf[1] = value; DALI_FF = DALI_MsgBuf[1] | (DALI_MsgBuf[0] << 8); DALI_Transmit(DALI_FF); timer_sleep_ms(5); break; case 1: // turn off DALI_FF = TURN_OFF | ((DALI_MsgBuf[0] << 8) | 0x01); DALI_Transmit(DALI_FF); timer_sleep_ms(5); break; case 2: // recall max DALI_FF = RECALL_MAX_LEVEL | ((DALI_MsgBuf[0]...
c,size,ram,msp430,object-files
What you are declaring are local variables. They will be stored in the stack. In the general case, the RAM size occupied by the stack cannot be determined at the compile time. However, for simple applications such a yours it's possible to estimate the upper bound of stack usage, either...
It looks like you have two interrupts in use: one for the capture compare on timer A0 (CCIE) and also the timer A overflow (TAIE). If you are getting stuck in the ISR_trap then that can be explained by the fact you do not have a handler for the timer...
elf,msp430,texas-instruments,mspgcc
Some of the names sections (such as .text) contain data that is actually loaded into the MCU. The ELF program headers, however, contain only metadata; their address does not matter....