Jump to content
43oh

Found a goldmine of MSP430 beginner code


Recommended Posts

Example code is often helpful, but newbies should be careful to not accept this as gospel. 

has:

Use #import <io.h> when developing programs when you have no specific microcontroller in mind (like tutorials?), and import the relevant header file when targeting a particular chip.

 

Use the standard names already available to you for bitmasks and important constants, because that is what people are accustomed to seeing.

 

Use + to combine bitmasks.

Two of the three recommendations are bad in at least one way each.  For the first, it's "#include <msp430.h>" rather than "#import <io.h>"; for the third see this recent discussion.

 

This is the guy who came up with the original solution for fixing dead Fraunchpads, though, so all of us who used his BSL code to repair them before the root cause was finally tracked down and fixed owe him a beverage of his choice.

Link to post
Share on other sites

Example code is often helpful, but newbies should be careful to not accept this as gospel. 

has:

 

Two of the three recommendations are bad in at least one way each.  For the first, it's "#include <msp430.h>" rather than "#import <io.h>"; for the third see this recent discussion.

 

This is the guy who came up with the original solution for fixing dead Fraunchpads, though, so all of us who used his BSL code to repair them before the root cause was finally tracked down and fixed owe him a beverage of his choice.

msp430.h and io.h would both work, with the difference being TI headers vs IAR's headers, in IAR Kickstarter (it might be io430.h, i'd have to double check). Even then, both of those files are just if defined, then include the specific relevant header file, for every model of the msp430.

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...