Pumpkin, Inc.

Pumpkin User Forums

absolute beginer

For issues specific to TI's MSP430 line of ultra-low-power microcontrollers, including compilers (e.g. Quadravox AQ430), IDEs (e.g. IAR Embedded Workbench) and development tools (e.g. TI MSP-FET430 Flash Emulation Tool).

Re: absolute beginer

Postby piratemurray » Fri Aug 04, 2006 1:46 am

i've played around with it a bit and sorted some things out. but still the errors keep coming. what am i doing wrong?

code:
#include <msp430x16x.h>
#include <salvocfg.h>
#include <mem.c>

unsigned int ADCresult;
unsigned long int DegC;

#define Task1_P OSTCBP(1)

void TaskMeasureAmbientTemp( void )
{
/* setup ADC12 to read ch 10, etc. */
ADC12CTL0 = ADC12ON+REFON+REF2_5V+SHT0_6;
ADC12CTL1 = SHP;
ADC12MCTL0 = INCH_10+SREF_1;
/* wait 10ms for reference startup */
OS_Delay(1, label);
/* enable conversions */
ADC12CTL0 |= ENC;
for (; ;)
{
ADC12CTL0 |= ADC12SC; // start conversion
OS_Delay(200, label); // wait 2s
ADCresult = ADC12MEM0; // read result
DegC = ((((long)ADCresult-1615)*704)/4095); // calc. DegC
}
}

void main(void)
{
OSInit();
OSCreateTask(TaskMeasureAmbientTemp, Task1_P, 7);
for (; ;)
OSSched();
}


the error is:

quote:
Build active project
Building “adctemptest” in configuration “Debug”
Compiling main.c
Compiling delay3.c
Compiling delay2.c
Compiling delay.c
Compiling mem.c
Linking adctemptest.hzx
C:/Program Files/Rowley Associates Limited/CrossWorks MSP430 1.3/bin/hld: duplicate symbol '_OScTcbP'
Build failed

my salvocfg.h looks like:

code:
#define OSBYTES_OF_DELAYS	 1
#define OSENABLE_MESSAGES TRUE
#define OSEVENTS 2
#define OSTASKS 3

once again, many thanx

[This message has been edited by piratemurray (edited August 04, 2006).]

piratemurray
 
Posts: 16
Joined: Mon Jul 03, 2006 11:00 pm
Location: london

Re: absolute beginer

Postby aek » Fri Aug 04, 2006 2:26 am

You #includes are all wrong.

1) Never include any of Salvo's source files. They belong as nodes in a project, not included files.

2) #include <salvo.h>, not salvocfg.h.

3) Set the project's include paths to include Salvo's Inc directory, and the directosry of your project.

Just like the example projects ...

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: absolute beginer

Postby piratemurray » Fri Aug 04, 2006 3:12 am

thank you very much! that has worked!

i can download the program now and have it running off the MSP430.

one other thing. i added a debug_printf linde after the calculation of DegC in the previous code (obviously after amending the #include lines).

that doesnt seem to have outputed anything.

in a nut shell i wanted to have the adc read and display the result of a temperature measurement.

i'm pretty sure the adc has made the reading since crossworks says its running fine. i just need to know how to extract that reading.

thanx again!

piratemurray
 
Posts: 16
Joined: Mon Jul 03, 2006 11:00 pm
Location: london

Re: absolute beginer

Postby aek » Fri Aug 04, 2006 3:17 am

For debug_puts() and debug_printf(), just look in the I/O console output window once you are running in CrossWorks ...

You can test by e.g. using debug_printf() at the start of main().

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: absolute beginer

Postby piratemurray » Fri Aug 04, 2006 6:00 am

i've tried that but doesnt work. the program downloads to the MSP430 fine but doesnt seem to run (i.e i cant see any output in the debug window)

incidently in crossworks the little egg timer icon that tells you how many clock cycles have passed doesnt move from 0. in my non salvo programs this always counted well into the thousands.

piratemurray
 
Posts: 16
Joined: Mon Jul 03, 2006 11:00 pm
Location: london

Re: absolute beginer

Postby aek » Fri Aug 04, 2006 8:57 am

For one thing, you haven't incuded the header file that is required to use those debug functions.

Look at salvoprodprod2sysx -- the project in there uses debug_puts().

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: absolute beginer

Postby piratemurray » Sat Aug 05, 2006 3:59 am

thanks for all your help!

i know it must be frustrating answering all my silly little questions. but i appreciate it. cheers mate!

piratemurray
 
Posts: 16
Joined: Mon Jul 03, 2006 11:00 pm
Location: london

Re: absolute beginer

Postby aek » Mon Aug 07, 2006 5:24 am

See
http://www.pumpkininc.com/ubb/Forum19/HTML/000027.html

and
http://www.pumpkininc.com/ubb/Forum19/HTML/000047.html

The simple way to check is look at the size of the application after it's built (Symbol Browser window). If it's big (e.g. 4-8K), then you've got all the code linked in. If it's small ( <2K), then it hasn't got everything, and nothing works.

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: absolute beginer

Postby piratemurray » Mon Aug 07, 2006 6:39 am

hello again!

good news is i am understanding more and more about salvo, the RTOS that runs in tiny places.

bad news is that still none of my programs seem to want to run. for that matter, none of your example programs or tutorials appear to run either.

for example. opening the tutorial 2, prod2, and ex1 project files in the salvo directory and running them yielded no results. by that i mean the code compiled and downloaded; the little green light icon flashed; but nothing happened. there was no output to the debug window and when using the various windows in crossstudio to keep an eye on variables whilst debugging nothing came up.

as far as i can tell. nothing works. not only with the programs i have built but your programs as well.

i havent come across this in the forums so far and over the weekend i followed your advice and reread all the tutorial programs and tried them without success. it is now increasingly frustrating that SALVO does not seem to want to run.

incidently, i am able to build C programs and download them onto my MSP430F169 perfectly well. it is only when SALVO is involved do the problems arise.

your insight is much appreciated.

piratemurray
 
Posts: 16
Joined: Mon Jul 03, 2006 11:00 pm
Location: london

Re: absolute beginer

Postby piratemurray » Tue Aug 08, 2006 2:37 am

thanks aek. finally after nearly tearing out all my hair the programs work!

in the end it was simply needed to include startup code as the first link suggested. projects were slightly larger than before but worked perfectly. even my own ones that i created.

its the frustrating problems that always turn out to be so simple to solve!

thanks again!

piratemurray
 
Posts: 16
Joined: Mon Jul 03, 2006 11:00 pm
Location: london

Previous

Return to TI's MSP430

Who is online

Users browsing this forum: No registered users and 1 guest

cron