01-05-08

MSP430 Programming

This week I am working on my first steps to program a MSP430 microcontroller. I use the eZ430-RF2500 kit I which I get from the MSP430 day.

 I have tried to install the mspgcc compiler. I download the code I do a spi-bi-wire. When I try to debug and type C (continue for program on MSP430) the code is nog running. There is a problem that I have to figure out the following days. I keep you updated and will maybe soon publish a tutorial for programming the MSP430 eZ430-RF2500 kit with mspgcc when my problems are solved :-)

 

 

11:14 Gepost door Mobile blogger in Algemeen | Permalink | Commentaren (0) | Tags: msp430, zigbee, rf, gcc |  Facebook |

23-01-08

Bash Scripting

I just wrote a 6 slides long introduction to Bash Scripting.

This introduction is only for people who already know how to power on and off a computer :-)

 Read it and let me know what you think.

Bash Scripting

Vincent Claes

http://www.mobile-it.be

 

mkdir DevProject

cd DevProject

nano testprogram.c

put in this file the code for c program (for example see next slide)

control + o

press enter to save file to testprogram.c

control + x to exit nano

nano bashscript.sh

put in this file code for bash script

control +o

press enter to save file to bashscript.sh

control + x to exit nano

chmod 744 bashscript.sh

./bashscript.sh testprogram

* (if you want to use this script for other c-files you can do it by using ./bashscript.sh <putherefilenameofprogram without .c> )

C Program

// created by Vincent Claes

//http://www.mobile-it.be

#include <stdio.h>

main()

{

printf("Hello Worldn");

}

Bash Program

#!/bin/sh

#Created by Vincent claes

echo "Script to automatically compile and run C program"

gcc $1".c" -o $1

./$1

Cygwin Screen

Bash Script for viewing assembler code

#!/bin/sh

#Created by Vincent Claes

#http://www.mobile-it.be

echo "Script for viewing assembler file created from C program"

gcc $1".c" –S

cat $1".S"

 Link: Slides

20:48 Gepost door Mobile blogger in Algemeen | Permalink | Commentaren (0) | Tags: assembler, scripting, bash, slides, compiler, gcc |  Facebook |

22-11-06

Importing Assembler code into a C application

Here you find an example of implementing assembler code into a C application that you can build with your Visual C++ compiler... When you put 'Inline Assembler' in the magic google box you get more information about this topic. I have only tested this on Visual Studio 2005, not on GCC or other compilers, you can best check your compiler for how to implement assembler code into your C program.

Have fun...

 

#include <stdio.h>
 
main() {
 
    int arg1=3;
     int arg2=4;
     int Result;
 
_asm{
MOV arg1,202
MOV arg2,125
MOV EAX,arg1
MOV EBX,arg2
ADD EAX,EBX
MOV Result,EAX
}
   printf("%dt%dt%d",arg1,arg2,Result);
}

18:42 Gepost door Mobile blogger in Algemeen | Permalink | Commentaren (0) | Tags: assembler, ansi, c, inline, gcc, visual studio 2005, download, example |  Facebook |