Jump to content
43oh

Neewbie line code question


Recommended Posts

Hello everyone, so, i finally have the time to work on my launchpad. I've been reading some things and i have a question.

this line:

 

:arrow: #include

 

i have to use this only if i'm using the chip msp430g2231 or it's jut for "importing" a command or that chip functionality.

 

Thank you or your answer.

Link to post
Share on other sites

have a look at the file, it defines quite a bit of stuff. while its always best to have the matching header a lot of the functionality is the same for the range and you can get away with a similar chip like the msp430g2001. or the f series.

on my linux box the header is also calling for these:

#include

#include

#include

#include

#include

#include

Link to post
Share on other sites

It's the header file for that particular chip which maps #defines to appropriate peripheral addresses.

 

Just a small suggestion since you asked this kind of question... it would be better if you read up on the basics of C first. You already come from a programming background(Web), so it should not be too hard. This will only help you later.

 

Welcome to the Forums. Keep asking your questions.

Link to post
Share on other sites

Thank you both for your answers.

 

It's the header file for that particular chip which maps #defines to appropriate peripheral addresses.

 

Just a small suggestion since you asked this kind of question... it would be better if you read up on the basics of C first. You already come from a programming background(Web), so it should not be too hard. This will only help you later.

 

Welcome to the Forums. Keep asking your questions.

 

Thanks, i use c a lot and also learn that before php, i have this doubt with the include because i was set on this:

if the launchpad came with the 430g2553 why are they using this? is it like math.h an they include this to use #pragma vector

or they actually using this other chip.

Link to post
Share on other sites

The LP used to come with a '2211 and a '2231, the TI examples are written for those. You'll need some creativity porting them to the '2553, but it's quite doable with a bit of thinking and consulting the appropriate headers (msp430g2231.h and msp430g2553.h in this case). It's going to be register name differences mostly.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...