Jump to content
43oh

Moving past Blinky


Recommended Posts

Hello everyone,

 

Ok, I've taken my first baby steps into programming the MSP430 I have an it seems to have been successful. Thank you all for the assistance you have given, and the great links and books that I am still chewing my way through. Specifically the MSP430 Programming Basics one.

 

To give a little background on my setup, I have an MSP430AFE253 sitting in a MSP-TS430PW24, the P1.0 LED blinking merrily, with the MSP-FET430UIF plugged into the JTAG and Code Composer Studio v5 on my Windows 7 computer. Phew! Is anyone else using this equipment? lol Oh and yes, I know the PW24 was way overkill and I should have bought the Launchpad... If anyone wants to explain to me what I would need in order to take this tiny MSP430AFE253 and put it into a launchpad and program it, I'm all ears!

 

Anyway... now I'd like to take my learning a little further with the blinky example. I have an LED, but to my amazement, it's not as easy as just plug the LED into pin holes 11 and 12 and the LED blinks instead of the one on board. Here is the code I played with and modified a bit. Anyone have insight? I really wish there was some MSP430 videos explaining plug this here, that there, load this sample code and viola! I'm a trial and error type of personality, so if I can get it to work, I am usually pretty good at tweaking and adding/modifying things to see how it is affected.

 

Thanks :?

-Mike

 

The code

#include 

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

for(; {
	volatile unsigned int i;	// volatile to prevent optimization

	i = 50000;					// SW Delay
	do i--;
	while(i != 0);
	P1OUT ^= 0x01;				// Toggle P1.0 using exclusive-OR

	i = 20000;					// SW Delay
	do i--;
	while(i != 0);
	P1OUT ^= 0x01;				// Toggle P1.0 using exclusive-OR

	i = 75000;					// SW Delay
	do i--;
	while(i != 0);
	P1OUT ^= 0x01;				// Toggle P1.0 using exclusive-OR

	i = 70000;					// SW Delay
	do i--;
	while(i != 0);
	P1OUT ^= 0x01;				// Toggle P1.0 using exclusive-OR
}
}

Link to post
Share on other sites

to program non-dip 430s you just need the chip on a board with a few pins broken out into a header, and another riser on the launch pad with matching connections and no micro.

 

as for the led, first make sure the led is rated for the right voltage. a 12v led won't do much off a 3v signal line. Its also a good idea to run a current limiting resistor on there to be safe

Link to post
Share on other sites

Not sure if the msp430afe253 is supported by the programmer (honestly, never knew there was a afe model), but since it has SBW, connect DVCC & AVCC (16 & 5) to Launchpad VCC, DVSS & AVSS (13 & 6) to Launchpad Gnd, and (RST) pin 11 to Launchpad RST, and (TEST) pin 10 to Launchpad RST. Then you should be good to go.

Link to post
Share on other sites

thank you mbeals and cde!

 

I am going to order a launchpad kit just so I can have it and become familiar. Most of the examples and help here is based around it, and in the end, I want to be able to take the programmed chip (MCU) and use it standalone so the dev kit shoudn't matter.

 

The reason I was drawn toward the afe series was I had wanted to build a cheap energy monitor for inside of an outlet. I want to have some type of wireless communication for switching on and off and a tiny LCD screen to display usage. while googling, I came across the TI Smart Energy Meter, which in the diagrams has the AFE chip. It says it's built specifically for these type of applications, so it made sense to me.

 

One thing I still get hung up on is the size of the chip. I like the size since I want it to fit in an outlet, butdo they make breadboards that fit a chip that small! I keep hear I/C Sockets, but I don't want to have to buy a 50 dollar socket just to use the chip. and it's bulky too. haha

 

Anyway, thank you again!

Link to post
Share on other sites

There was an article on hackaday showing how to break out the SBW from the launchpad for other chips. Just search google for using-spy-bi-wire-with-the-msp430-launchpad. It should be the first result.

 

To mount that chip, you can make your own socket by pressing the chip into some polymer clay to make an impression, baking it to harden it, then using some fine copper wire to make contacts. Glue that on some perf board and run some wires from the contacts to some headers and you have a homebrew socket. For the final project, you will probably want to make a real board, or at least a breakout board with the chip soldered on.

Link to post
Share on other sites
thank you mbeals and cde!

 

I am going to order a launchpad kit just so I can have it and become familiar. Most of the examples and help here is based around it, and in the end, I want to be able to take the programmed chip (MCU) and use it standalone so the dev kit shoudn't matter.

 

The reason I was drawn toward the afe series was I had wanted to build a cheap energy monitor for inside of an outlet. I want to have some type of wireless communication for switching on and off and a tiny LCD screen to display usage. while googling, I came across the TI Smart Energy Meter, which in the diagrams has the AFE chip. It says it's built specifically for these type of applications, so it made sense to me.

 

One thing I still get hung up on is the size of the chip. I like the size since I want it to fit in an outlet, butdo they make breadboards that fit a chip that small! I keep hear I/C Sockets, but I don't want to have to buy a 50 dollar socket just to use the chip. and it's bulky too. haha

 

Anyway, thank you again!

 

Tssop (tsop) (ssop) to dip adapters are cheap. 2 to 1 dollar on ebay. There is one that's double sided 28 pin soic and ssop, 2 for 2.20. All you need is one that has atleast 24 pins, and 0.65" pitch between pins. Unless you want a zero insert force adaptor.

 

The other options is a ssop adaptor that has a small prototyping area on it. Kinda useful depending on how much of a circuit you need to build (The pin outlines are long, so doesn't really work well for chips with a center grounding pad) (Oh, and you need machine pins instead of square pins, unless they finally change their supply, or you want to ream them out a bit, not a big hassle)

Dip Micro has them, or ebay "ssop prototype". Cheaper on ebay actually, even from their ebay store. (Disclaimer, not affiliated, but i've gotten this from them before and I likey)

post-117-135135569914_thumb.jpg

Link to post
Share on other sites

Wow that is some great info. I really appreciate that. I love the idea of polymer clay too! But to just get started, I'm going to check out this adapter for now.

 

http://www.proto-advantage.com/store/pr ... OgodkAkAZQ

 

One other question. If I want to use an LCD display, what is a good one to play with that can display something like "888.88 W" and a backlight ability? Does it have to have a controller or whatever it is called built into it?

Link to post
Share on other sites

LCDs are plentiful. Any common character lcd will do what you want (You want hd44780-compatible, 3.3v preferable, but 5v works fine too). There are also graphic lcds like the nokia displays. The character lcds have a basic controller on them, fairly easy to control directly (but needs a couple of pins), or can be bought with "backpacks", allowing you to control them via i2c, spi, or serial.

 

The nokia lcds have a PCD8544 (or similar, it always depends on which nokia lcd you get), which is spi controlled.

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