Reply by Bruce Cannon August 10, 20042004-08-10
You'd better try out CrossWorks' free trial before counting on it
to help
you come up to speed.  It's a great tool but it's definitely designed
for
the advanced user.  The interface is nice looking but very complicated.
There is no manual, the help system is quite cursory, as is the single
tutorial.  There is popup help but it is still in early stages: a great many
popups simply reiterate the button tags.

If you are very experienced you will most often be able to intuit how to get
it to do what you want and will likely be pleased with its performance.  If
you are a beginner you should prepare for a steep learning curve.  Having
said that, there is a Yahoo group for the tool and response time to
questions is typically good.  I have yet to see a post from a beginner
though.

--Bruce


> That's what I've been trying to do. 
Just learn to exercise the
> digital I/O first, get on to the LCD next and then get into
> interrupts and ADC etc.  I did buy the printed TI user guide and I
> think I will go ahead and print the IAR reference manuals too. But
> there are too many pages to print on that and I want to consider the
> cost of printing all that vs. buying some IDE like Crossworks which
> may have better help/tutorials than the PDF files.



Beginning Microcontrollers with the MSP430

Reply by josef104 August 10, 20042004-08-10
>But if you want to have a look at the software I wrote for the LCD 
>anyway, let me know.

Yes, please send me your files.  It may help me to learn some simple 
stuff by cross referencing with the 449 kit's schematics. 
 
>Take one step at a time, like input/output/LED
which is a good 
>start. Next you would want to take care of interrupts, timing and so 
>on. You can also ask this group if you are stuck on anything.

That's what I've been trying to do.  Just learn to exercise the 
digital I/O first, get on to the LCD next and then get into 
interrupts and ADC etc.  I did buy the printed TI user guide and I 
think I will go ahead and print the IAR reference manuals too. But 
there are too many pages to print on that and I want to consider the 
cost of printing all that vs. buying some IDE like Crossworks which 
may have better help/tutorials than the PDF files.

Thanks for everyone's help.  This group is great.  I tried posting in 
Olimex/sparkfun forum first with no responses.  The example program 
they had on their site for the kit I bought has compile errors.  I 
wish there were other vendors with some better value added services 
for their products, may be I ought to look at Softbaugh.  Or may be 
one of you experts can start looking into selling a kit with a bunch 
of programs that go with the kit!

Thanks,
Joseph 


Reply by Matthias Weingart August 10, 20042004-08-10

On Tue, Aug 10, 2004 at 04:41:39AM -0000, josef104
wrote:
> 2) Does anyone have any example programs in C for the MSP430F413STK2 
> kit?  I am trying to learn to display stuff on the LCD on the board.

Download the codeexamples from ti (you find it under design resources).

        Matthias

Reply by Bruce Cannon August 10, 20042004-08-10
Or for modifying only your target pin, you could type 

P6DIR &= ~PIN2;

--Bruce



> Hi, 
> 
> > 1) I learnt how to set a digital I/O pin to be set as output (for
> > example: P6DIR |= 0x04).  How do you set it as an input?
> > 
> > Set 0 for those bits desired as input. If you want all input, 
> > it is P6DIR |= 0x00
> 
> Actually not.  P6DIR = 0 or P6DIR &= 0, but certainly not P6DIR |= 0.
> 
> -- Paul.



Reply by IL August 10, 20042004-08-10
Sorry, completely overlooked it. OR won't work as Paul said.
  ----- Original Message ----- 
  From: Paul Curtis 
  To: msp430@msp4... 
  Sent: Tuesday, August 10, 2004 6:49 AM
  Subject: RE: [msp430] Re: LED Blink


  Hi, 

  > 1) I learnt how to set a digital I/O pin to be set as output (for
  > example: P6DIR |= 0x04).  How do you set it as an input?
  > 
  > Set 0 for those bits desired as input. If you want all input, 
  > it is P6DIR |= 0x00

  Actually not.  P6DIR = 0 or P6DIR &= 0, but certainly not P6DIR |= 0.

  -- Paul.



  .




        
             
       
       


------
  . 






Reply by IL August 10, 20042004-08-10
1) I learnt how to set a digital I/O pin to be set as output (for 
example: P6DIR |= 0x04).  How do you set it as an input?

Set 0 for those bits desired as input. If you want all input, it is P6DIR |=
0x00

2) Does anyone have any example programs in C for the MSP430F413STK2 
kit? 

Unfortunately not. The Olimex.com website will have a few programs in assembly
but that's about it. Sadly, these files don't even have proper
documentation with them. To run the kit in C, you will need to convert these
assembly programs in C. It will not be easy for a beginner. I bought the
MSP430F449STK2 because it came with an LCD module on the kit. It took me the
MSP430F449 User Guide (read on LCD:4-Mux), Olimex's LCD Datasheet (which is
really dumb) and Olimex's MSP430F449STK2 pin connections before it made any
sense. Took me about a week to figure it all out, longer than I expected. I
wrote a couple of functions to do a number of cool tricks for the LCD, display
numbers, text, scrolling text and sentences and so on. But that was about it.
Your kit (MSP430F413STK2) uses a different LCD, so the pin connections may be
different. Also, activating the segments on the LCD will be different. But if
you want to have a look at the software I wrote for the LCD anyway, let me know.
The other stuff like serial communcation, ADC etc etc are covered in adequate
detail in TI demo C files. I conquered the LCD first because I can use it in
debugging all my projects, which is really useful.

3) I searched for books to try to learn how to program the device, 
but really couldn't find anything (the only book on amazon looked 
like the user guide from TI and had bad reviews).  I have the 
MSP4304xx user guide and data sheets from TI, but they don't give 
much help on programming (like my question 1). I am also trying to 
read the guides that came with IAR EW.  Any tips/resources on how a 
beginner should approach learning to program this device?

In fact, I bought the TI book that everyone is talking about from Amazon.com but
I found it a poor source for ideas or reference (it will leave you more
confused). Stick with the TI documentation (User Guide) for your chip, and
master to use IAR software. Printed copy of these documents will be helpful than
swapping windows. You won't find specific software in C for your kit, but
you will find C code for your chip from TI Website. Take one step at a time,
like input/output/LED which is a good start. Next you would want to take care of
interrupts, timing and so on. You can also ask this group if you are stuck on
anything.

IL


----- Original Message ----- 
  From: josef104 
  To: msp430@msp4... 
  Sent: Monday, August 09, 2004 10:41 PM
  Subject: [msp430] Re: LED Blink


  Thanks for the help guys. Got a couple of more questions:
  1) I learnt how to set a digital I/O pin to be set as output (for 
  example: P6DIR |= 0x04).  How do you set it as an input?
  2) Does anyone have any example programs in C for the MSP430F413STK2 
  kit?  I am trying to learn to display stuff on the LCD on the board.
  3) I searched for books to try to learn how to program the device, 
  but really couldn't find anything (the only book on amazon looked 
  like the user guide from TI and had bad reviews).  I have the 
  MSP4304xx user guide and data sheets from TI, but they don't give 
  much help on programming (like my question 1). I am also trying to 
  read the guides that came with IAR EW.  Any tips/resources on how a 
  beginner should approach learning to program this device?

  Thanks,
  Joseph


  --- In msp430@msp4..., "cybermace5" <cybermace5@y...> wrote:
  > > You're toggling P6.0 and P6.1 (the 0x03 is bits 0 and 1).  Try 
  P6OUT ^  > > 0x04.  You might want to use P6DIR |= 0x04 as well, to set
the 
  port bit
  > > as output.
  > 
  >                            Pins
  >            | 7 | 6 | 5 | 4 |  | 3 | 2 | 1 | 0 |
  >            |---------------|  |---------------|
  >            | 8 + 4 + 2 + 1 |  | 8 + 4 + 2 + 1 |
  > PxOUT = 0x         _                  _
  > 
  >             10:A, 11:B, 12:C, 13:D, 14:E, 15:F
  > 
  > 
  > Until decimal-binary-hex becomes second nature, new coders should 
  draw
  > something like this to remember how to encode the two digits. Simply
  > look at the port pins you want to activate and add up the
  > corresponding numbers below, converting to the appropriate letter if
  > above 9. That can help avoid these frustrating little errors that 
  are
  > so easy to make.



  .




        
             
       
       


------
  . 






Reply by Paul Curtis August 10, 20042004-08-10
Hi, 

> 1) I learnt how to set a digital I/O pin to be set
as output (for
> example: P6DIR |= 0x04).  How do you set it as an input?
> 
> Set 0 for those bits desired as input. If you want all input, 
> it is P6DIR |= 0x00

Actually not.  P6DIR = 0 or P6DIR &= 0, but certainly not P6DIR |= 0.

-- Paul.


Reply by onestone August 10, 20042004-08-10
josef104 wrote:
> Thanks for the help guys. Got a couple of more
questions:
> 1) I learnt how to set a digital I/O pin to be set as output (for 
> example: P6DIR |= 0x04).  How do you set it as an input?

If a pin is not an output then it is an input. At power up, by default, 
all pins are inputs.

> 2) Does anyone have any example programs in C for
the MSP430F413STK2 
> kit?  I am trying to learn to display stuff on the LCD on the board.

Have you looked on the ftp site for this group?

> 3) I searched for books to try to learn how to
program the device, 
> but really couldn't find anything (the only book on amazon looked 
> like the user guide from TI and had bad reviews).  I have the 
> MSP4304xx user guide and data sheets from TI, but they don't give 
> much help on programming (like my question 1). I am also trying to 
> read the guides that came with IAR EW.  Any tips/resources on how a 
> beginner should approach learning to program this device?

read the User Guide SLAU049. This is heavy going, but you'll need to 
start somewhere. I haven't read the book Micah mentions.

You are alwasy welcome to ask questions here.

Al


Reply by Micah August 10, 20042004-08-10
Amazon has "Embedded Systems Design using the MSP430 series" for
sale. I 
bought it and is worth the 25 bucks or whatever it costs. It has a cd with 
code with it, and some examples, and would be helpful for someone starting 
out I think. It was for me. 

-Micah 


On Monday 09 August 2004 09:41 pm, josef104 wrote:
>  Thanks for the help guys. Got a couple of more questions:
>  1) I learnt how to set a digital I/O pin to be set as output (for
>  example: P6DIR |= 0x04). How do you set it as an input?
>  2) Does anyone have any example programs in C for the MSP430F413STK2
>  kit? I am trying to learn to display stuff on the LCD on the board.
>  3) I searched for books to try to learn how to program the device,
>  but really couldn't find anything (the only book on amazon looked
>  like the user guide from TI and had bad reviews). I have the
>  MSP4304xx user guide and data sheets from TI, but they don't give
>  much help on programming (like my question 1). I am also trying to
>  read the guides that came with IAR EW. Any tips/resources on how a
>  beginner should approach learning to program this device?
>
>  Thanks,
>  Joseph
>
>  --- In msp430@msp4..., "cybermace5" <cybermace5@y...>
wrote:
>  > > You're toggling P6.0 and P6.1 (the 0x03 is bits 0 and 1).
Try
>
>  P6OUT ^>
>  > > 0x04. You might want to use P6DIR |= 0x04 as well, to set the
>
>  port bit
>
>  > > as output.
>  >
>  > Pins
>  > | 7 | 6 | 5 | 4 | | 3 | 2 | 1 | 0 |
>  > |---------------| |---------------|
>  > | 8 + 4 + 2 + 1 | | 8 + 4 + 2 + 1 |
>  > PxOUT = 0x _ _
>  >
>  > 10:A, 11:B, 12:C, 13:D, 14:E, 15:F
>  >
>  >
>  > Until decimal-binary-hex becomes second nature, new coders should
>
>  draw
>
>  > something like this to remember how to encode the two digits. Simply
>  > look at the port pins you want to activate and add up the
>  > corresponding numbers below, converting to the appropriate letter if
>  > above 9. That can help avoid these frustrating little errors that
>
>  are
>
>  > so easy to make.
>
>  .
>
>
>
>
>
>
> 
>
>
>
>
>
>
>
>  .

Reply by josef104 August 10, 20042004-08-10
Thanks for the help guys. Got a couple of more questions:
1) I learnt how to set a digital I/O pin to be set as output (for 
example: P6DIR |= 0x04).  How do you set it as an input?
2) Does anyone have any example programs in C for the MSP430F413STK2 
kit?  I am trying to learn to display stuff on the LCD on the board.
3) I searched for books to try to learn how to program the device, 
but really couldn't find anything (the only book on amazon looked 
like the user guide from TI and had bad reviews).  I have the 
MSP4304xx user guide and data sheets from TI, but they don't give 
much help on programming (like my question 1). I am also trying to 
read the guides that came with IAR EW.  Any tips/resources on how a 
beginner should approach learning to program this device?

Thanks,
Joseph


--- In msp430@msp4..., "cybermace5" <cybermace5@y...> wrote:
> > You're toggling P6.0 and P6.1 (the 0x03
is bits 0 and 1).  Try 
P6OUT ^> > 0x04.  You might want to use P6DIR |= 0x04 as well, to
set the 
port bit
> > as output.
> 
>                            Pins
>            | 7 | 6 | 5 | 4 |  | 3 | 2 | 1 | 0 |
>            |---------------|  |---------------|
>            | 8 + 4 + 2 + 1 |  | 8 + 4 + 2 + 1 |
> PxOUT = 0x         _                  _
> 
>             10:A, 11:B, 12:C, 13:D, 14:E, 15:F
> 
> 
> Until decimal-binary-hex becomes second nature, new coders should 
draw
> something like this to remember how to encode the
two digits. Simply
> look at the port pins you want to activate and add up the
> corresponding numbers below, converting to the appropriate letter if
> above 9. That can help avoid these frustrating little errors that 
are
> so easy to make.