Jump to content
43oh

Recommended Posts

Short answer: No

 

Long answer: You do not show any effort to let us jump on your train of thinking. You write posts consisting of a single line (with terrible spelling).

So far I know you want to use an MSP430 to measure some thing current-y and you are using an existing application (or template) that throws you messages.

I had to read three topics to combine this, summing up to 10 posts.

Please, we're glad to help, but you don't make it possible for us to actually help you.

 

What is your situation? Do you have a schematic or protocol description of the things you're interfacing with?

What have you tried thus far? What did work, what did not, what had you expected, did your results agree with that?

Where do you get stuck? What is the problem in that stuck point? How can we help there?

Link to post
Share on other sites

I just wanted to know the way in, the approach to do this..

Stuffs that are to be learnt...? Just them and them alone... Please anyone help me in this... Let alone this.. Enough...

There are getting started tutorials. You could watch youtube primers on the msp430 (which I am still planning to do myself sometime). You could buy/borrow a book on the msp430.

First things first, do you know how to program C or C++? If you don't better start there, unless you're willing to learn msp430 assembler (I do like the instruction set, I just do not like writing assembler).

Link to post
Share on other sites

"0x01 sets all but pin 0 to zero with pin 0 at 1. The LED is connected with its cathode at ground, so a high value on P1.0 turns on the LED. Thus 0x00 is off, 0x01 is on."

 

Here's my doubt:

When we direct p1.0 to have bit 1,

Well.. Ya... It has high value...

For the Current to flow in the launched in-built from p1.0 to ground through LED1, and hence the led to glow, there should be a voltage difference, right..? Does keeping p1.0 pin's value 1, is that enough to create the voltage difference?

Link to post
Share on other sites

I'd suggest that you do the following.

 

Everyone here is really helpful. Personally I've got a lot out of this site. However, it's not really fair to expect people to rush to help you unless you've put in a bit of effort first.

Link to post
Share on other sites

"0x01 sets all but pin 0 to zero with pin 0 at 1. The LED is connected with its cathode at ground, so a high value on P1.0 turns on the LED. Thus 0x00 is off, 0x01 is on."

 

Here's my doubt:

When we direct p1.0 to have bit 1,

Well.. Ya... It has high value...

For the Current to flow in the launched in-built from p1.0 to ground through LED1, and hence the led to glow, there should be a voltage difference, right..? Does keeping p1.0 pin's value 1, is that enough to create the voltage difference?

I think you're confused about what 0x01 means. It is a so called hexadecimal representation (a number written in base 16 instead of the usual base 10). Let me elaborate a bit:

 

The ports on the simpler msp430s have 8 pins each, called Px.0 Px.1 ... Px.7 (where x is the port number, 1 for example)

This allows us to use a byte (also called octet, meaning a group of 8 bits) to describe one bit (a zero or one) for each of those pins.

 

Let's write these bits explicitly and see what happens:

Binary 0000 0000 is the binary (base 2) representation for 0, which is written in hexadecimal as 0. To help the computer we need to prefix hexadecimal numbers by 0x, so hexadecimal 0 becomes 0x0 or 0x00.

Binary 0000 0001 means the least significant bit is one higher, so it represents 20 or 1, which is 0x1 or 0x01 in hexadecimal.

Binary 0000 0010 means the second least significant bit is one higher, so it represents 21 or 2, which is 0x2 or 0x02 in hexadecimal.

 

So each number can be written in either base 10 (decimal), base 2 (binary), base 16 (hexadecimal).

Base 10 is what we normally use, base 2 is the internal counting system of computers (since you only need to know about "on" and "off", or 1 and 0).

Base 16 is roughly a convenience; it's somewhat similar to base 10, but it hold exactly 4 (a round number) base 2 digits per base 16 digit.

Let's count from 0 to 20 in decimal and hexadecimal:

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

0 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 13 14

You see, we use A through F as extra digit representations.

 

Now, back to your confusion. In the line "0x01 will set all but pin 0 to 0 and pin 0 to 1.... Thus 0x00 is off, 0x01 is on" you misread the behaviour of bits:

0x01 will set pin 0 to 1 and all others to 0. This is because 0x01 is base 16 for the base 2 number 0000 0001. As you can see the most right digit is 1 and all others are 0.

If we number the digits as such:

7654 3210

0000 0001

You can clearly see that all bits (and thus pins) are 0, except for bit 0, which is 1.

It should also be clear that you cannot raise a bit above 1, since they're base 2 numbers.

 

Would we write the value 0x02 then this happens:

7654 3210

0000 0010

So pin 0 will NOT be 1 anymore, but instead is 0. pin 1 on the other hand becomes 1 now.

 

So basically any value in which the rightmost bit is 1 will result in pin 0 to be 1.

 

But, bits are computational units, not physical units. In the case of the Luanchpad a pin with value 0 will have a potential close to 0 volts with respect to ground, a pin with value 1 will have a potential close to 3.6 volts with respect to ground.

 

You cannot raise the voltage above Vcc (which is 3.6 volts), so your LED should have a forward voltage of no more than those 3.6 volts (which rules out using most blue or white LEDs).

 

I hope this clarifies things for you a bit, if not, feel free to describe which concepts cause you trouble.

Link to post
Share on other sites

Yeah... Thank you so much.... One more thing I just wanted to ask... A pin with value 1, how does it have a potential of 3.6 volts? Like.. Will there arouse any new connection it creates in itself inside the launchpad when we set some pin's value 1 ?

And, if suppose answer is yes, for that little transition we set for a pin between 0 and 1, then would it not require mechanical energy often to shift its position from ground level to Vcc and vice-versa?

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