Close

Setting up the environment

A project log for 1K Challange Laser

Draw the hackaday logo with a laser with less than 1K of data.

cyrille-gindreauCyrille Gindreau 12/09/2016 at 17:170 Comments

The first step is to install TI Code Composer studio and then start a new CCS project for this Microcontroller

Once created Code Composer studio started off with a real basic main.c file

#include <msp430.h> 

/*
 * main.c
 */
int main(void) {
    WDTCTL = WDTPW | WDTHOLD;	// Stop watchdog timer
	
	return 0;
}

Just using main.c we compiled and ran to see where we were in terms of memory

MSP430: There were 46 (code) and 38 (data) bytes written to FLASH/FRAM. 
The expected RAM usage is 160 (uninitialized data + stack) bytes.
To fully understand what the code was being used for, we wanted to see the Assembly along with the map file. We enabled these features by clicking Project -> Show build settings.

In the settings, we applied some basic optimization. The first was to tell the compiler to optimize for space instead of speed.

Then under Processor options we set the code memory model to be small. This just tells the processor to use the first 64k of memory. We are unsure if this will help with space but it may make looking at the disassembly a bit easier.

We wanted to see the Assembly files generated by the compiler. So we clicked the option to keep the assembly file as well as add the source interlist so we can see the C code in the comments with the assembly.

And finally we set up our view to show the assembly side by side our C code.

Discussions