Jump to content
Sign in to follow this  
hova

ASM questions...

Recommended Posts

Hey everyone....It's me again.

 

 

I have been reading some of the users guides , and looking at a lot of sample code. So far what I am noticing is that the ASM code makes more sense to me than the C code. Every time I google C code (or look in one of the three books I have tried learning C from) , I just get lost. ASM seems to be logical to my brain , and since the C gets compiled and assembled , why not skip it and go straight to the low-level stuff.

 

 

If you dont know from my other post , I have been trying to make a voltmeter that displays a binary led indicator. From what I am reading , I am going to use a selectable range set of voltage dividers for 0-5v+ , 5-10v+ and 10-15v+. I am almost surely going to use a USB regulator (automotive outlet) which I can use readily available extentions for , and easily modified to attatch directly through a car battery. My concern is that IF I run from a regulator , will I still be able to test external circuits? As in , if I am clamoed directly to the battery up front , and I'm traicing power to a Seat sytem , will I have to get my power and ground from the circuit being tested , or will the ADC pick up the input.

 

My other concern , is that I want to implement a ground identification LED , and also be able to test a ground. I know this can be done by other Uc's , but all I find about ground monitoring , is basically if voltage is 0 , then it would be considered ground. Is there a simple enough way to identify a good ground with a Uc? Using a test light , I would just attach the lead to a hot , and test my ground.

 

 

Thats about it for now. The more I read and try to put a schematic together , the more lost I get. I think I will be taking the output of the voltage divider , feed one of the ADC lines , convert it to a visual binary output (still figuring this one out , is it as simple as "if voltage == 5 , output LED @ 1's position , and LED @ 4's position" ?) . From the datasheet , it looks like I may need to drive the LED's with an NPN transistor on each LED , but I'm obviously no engineer. I am also thinking of just having a green LED to indicate ground , which I dont think would need to be controlled by the uC.The voltage LED's are going to be blue (3.2Vf @ 30mA max) .

 

Sorry for the uber-noob questions , but the bkinky program just doesnt show much. I'm looking over the header files , but I'm not even sure I will be using them with ASM coding.

 

 

Thanks guys and gals

-Jason

Share this post


Link to post
Share on other sites

I have been reading some of the users guides , and looking at a lot of sample code. So far what I am noticing is that the ASM code makes more sense to me than the C code. Every time I google C code (or look in one of the three books I have tried learning C from) , I just get lost. ASM seems to be logical to my brain , and since the C gets compiled and assembled , why not skip it and go straight to the low-level stuff.

 

Bingo. With any uC assembler code make more sense. And with some experience, there is no C that will give you so deep optimization that can be done manually on low-level in assembler.

Share this post


Link to post
Share on other sites

ASM is over my head, but from what I can tell, being even more noob than you, you shouldn't need a transistor to drive an LED if the current is limited accordingly (assuming only one LED is being driven)... and green LED's seem to tolerate more current than amber, which tolerate more than red.

Share this post


Link to post
Share on other sites

I had another post detailing the plans (see http://forum.43oh.co...nary-voltmeter/ and http://www.dutchforc...showtopic=40009) .

 

The spoiler for those links is this :

Automotive test light as the basis , with an LED display in the style of binary clocks ( 4 blue led's , 1's Place , 2's Place , 4's and 8's) for voltage illustration. A test light will work with the ground clamp hooked to either ground or B+ (enabling you you test for presence of ground). This is where the green led will come in , basically tied directly into a voltage source , with a diode or some sort of one-way buffering (might even just run it from a low-signal code internal to the uC. ) ... I dont know if using a LOW sig line would work , because I suppose there could be the chance that presence of ground not actually being a ground circuit. I have some thoughts of using a signal injector to backfeed the main ground circuit , but that is getting ahead of myself.

 

 

I am at the point where I have drawn up some diagrams , flow charts , and pickled around with some numbers (such as the three way voltage divider) and some ideas just to get them down on paper , but none of it is really anything that I'm even sure will work...

 

Here's most of my sketches and doodles streamlined into a sort of overview/schematic...

flow.bmp

Share this post


Link to post
Share on other sites

I have also thought of using the optional green LED , via PWM output , to display the perentage of voltage till next volt (see display legend below. )

 

As for the physical implementation , I am planning on using the MSP in the launchpad for programming and testing/debugging , then free-forming the circuit , if possible , so that it can fit into the handle of the test light I currently use ( something like this test_light.jpg

Another thing I have been considering , is encapsulating the LED's in crystal epoxy , but first flattening the rounded tip of the LED , and then either sand-blasting or scuffing the led so that it glows instead of directs light. My other idea was to flatten the led , but separate the individual LED layers with gold leaf. I am picking some gold leaf up tomorrow to test the idea , and see how it or IF it even works.

 

Thanks everyyone.

-hov

Share this post


Link to post
Share on other sites

Looking for some input on the ideas of the voltage divider mostly , if anyone could check it out like i have it shown , running a 5v divider network (for circuits under 5v) , a 10v(under 10v) , and then working both DivNet's to accomplish 15v divider. (14.6 is the normal operating voltage of a running automobile) .

 

 

Also , any tips on places to find info on ASM for the msp430 G2's ? I have found a few tutorials but nothing with a listing of the actual code. going to stop at B&N and see what they have to offer tonight after work.

 

 

Thanks all!

-hov

 

 

ps: Jazz ; that Fchip breakout is just gorgeous. Science is art , afterall...

Share this post


Link to post
Share on other sites

You can find the example ASM code in here for the 2xx3 series MSP430's http://www.ti.com/lit/zip/slac485, ton's of other code examples here: http://www.ti.com/ls...430codeexamples

 

I've been wanting to learn ASM myself, I have modified ASM code a few times and found it very easy to understand the gist of whats going on, much more so than looking at C/C++ code and trying to figure out whats happening.

 

As to your question about grounds, I'm pretty sure as long as the circuit you're testing is not isolated any ground should work, be it the frame, battery or 12 outlet. I'm pretty sure stuff like the airbag is isolated though. You will need to filter the input to the uC/ADC as the DC on cars can have A/C noise due to bad rectifiers and the sort a lot of times.

Share this post


Link to post
Share on other sites

I was actually thinking of that , but i have a small circuit that I am putting togethre as the second half of this , that will be sort of like the tracer part of the signal injector. I am going to have a pole indicator (including AC) , because this is only going to be used for quick testing. If something is bad , I get out the multimeter. Maybe v2 will have more features , but I thought this would be a simple enough thing to figure out.

 

I will look at the code link you gave me tommorrow , as I have been reading a lot of the blog concerning ASM , and the user guide with ASM info is very long and mostly just specifies which identifiers , etc have to be formatted...

 

 

Thanks !

Share this post


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.

Sign in to follow this  

×
×
  • Create New...