Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LaunchPad MCU Programmer

Status
Not open for further replies.
No problem. The IDE is modified Eclipse so you'll see that format in other IDE's as well.

There is no binary number specifier that I know of in any standard C. I used to use a header file with definitions for them all, but now I just avoid specifying anything in binary. It helps to use the bitwise complement operator (~) if you want to specify everything but a specific bit, so 0b11111110 would be the same as ~(0x01).


Attached the binary header file. Everything starts with 'b', because you can't start a definition or variable name with a number.
 

Attachments

  • binary.h
    7.1 KB · Views: 109
There is no binary number specifier that I know of in any standard C.

Standard C doesn't have bits, its one of it's annoying weaknesses. :( A good microcontroller C compiler (like MikroC for PIC) lets you use 0b00000110 to represent byte size values. I don't think MikroC have a version for the MSP430 though.

DirtyLude, how do the MSP compare with PICs for price and ROM/RAM/MIPs? I've been looking for a fast *cheap* 16bit processor with plenty of ROM and RAM and I don't really care much at all about peripherals as long as it has decent 16bit timers. By the time PICs get 16bit (ie PIC24/33) they are bloated with expensive peripherals and still not fast in terms of MIPs anyway.
 
I'm not certain how they compare with the PICs on price. PIC has a huge lineup and I've never used PICs except for the original playing with the 40pin DIPS years ago.

They are pretty good price per board, since they can be used standalone up to 16Mhz without an external crystal, so the parts and board space for that are reduced. I believe they offer DIP packages as well.

I've generally limited myself to Cortex-M3 and MSP430 for projects now rather than jump around to a bunch of different microcontrollers like I've done in the past.
 
Thanks Guys,

Just got mine today; I was prompted by reading this thread. :)

I rode it home on the back of an order from work, so all together $4.74 from Digi. :D

Very impressive, what they send you for so little cash! For the price, one for each project sounds good.

I've had time only to install CCS, but have not taken it for a drive yet. Hope I get some play time this weekend.
 
Thanks Guys,

Just got mine today; I was prompted by reading this thread. :)

I rode it home on the back of an order from work, so all together $4.74 from Digi. :D

Very impressive, what they send you for so little cash! For the price, one for each project sounds good.
I just got two today. Hell of a bargain.
 
The MSP430 series are pretty good for getting started with µC's.

Just for everybody's reference, here's some code I did which will flash P1.0 and P1.6 using the MSP430G2231 (included in package).

Code:
#include <msp430g2231.h>
#define PAUSE 15000


int main(void)
{
  WDTCTL = WDTPW + WDTHOLD;             // Stop watchdog timer
  P1DIR |= 0x41;                        // Set P1.0 to output direction

  while(1)
  {
	int i;            // Counting Delay Variable

	P1OUT = 0x01;
	for(i=0;i<PAUSE;i++);
	P1OUT = 0x00;		// Disable Output
	for(i=0;i<PAUSE;i++);
	P1OUT = 0x40;
	for(i=0;i<PAUSE;i++);
	P1OUT = 0x00;		// Disable Output
	for(i=0;i<PAUSE;i++);
  }
}
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top