PDA

View Full Version : am I being rude to ask this. . .ASM code request



camcompco
- 9th March 2013, 19:38
First off, if this is a rediculous request than please default to the beliefe that I did not mean to go there. . . .I hope this is an easy request for someone who understans ASM code

This is what I would like to have in ASM:

for i = 1 to 100
High A
Pause j
Low A
pause j
if XYZ > 1000 then goto QUIT_ALL
next i


is this an easy request or am I being rude to assume sucha pita request :-)?

I have no idea on which side of the spectrum I am on. . . .5 min or 5 hrs

thanks to anyone who helps or shows me the error in my thinking

all the best

John

Heckler
- 10th March 2013, 16:01
pretty sure anyone good at assembly (not me) could do this in 5-10 minutes.

Most prefer that YOU make the attempt first and post your efforts here to show YOU are trying.

Otherwise just offer to pay someone here and you would probably find someone willing to do it.

Acetronics2
- 10th March 2013, 19:36
Hi,

I think you coul find very easily on the web the famous " blinking Led " program written in assembler ...

every assembler tutorial might show these lines as first example for beginners ...

Alain

Got it ...
http://www.gooligum.com.au/tutorials/baseline/PIC_Base_A_2.pdf

Demon
- 10th March 2013, 22:13
Don't we get an ASM listing when we compile?

I'd just write it in PBP and see what comes out.

Robert

camcompco
- 11th March 2013, 01:01
Hi Robert (et al)
That was my first thought as well, I looked at the asm when I compiled the small PBP program, extracted it and tried to run, got a bunch of errors, thought. . .Ummmmm that must not be ok to do ;-) Is that something that should have worked just fine? Is it as easy as slapping asm in front of the cut/paste of code and following with an endasm statement? if so, then I will try again.


to be fair, I stopped there.

As for your reply Dwight, i hear ya loud and clear on that one, i guess i looked at the "i really don't want to learn ASM unless i have to and if someone could quickly lend a hand then i thought, what the hey". I equate it to me writing an excel macro for some acquaintances to make their life easier, i am good at that and for them to even attempt it would take quite a while and unless they wanted to learn macros all that would be accomplished is that 2 people put effort in (as they would most likely fail without the dedicated time spent) that all said, again, i understand what your saying and take no issue with your thinking. . . .how could I. . .your right :-) but to put the "this john guy is a lazy bum" thought to rest (slightly). . .In the past month I have learned PIC-Basic (for the most part anyway), developed an understanding of stepper motor control, gathered a basis understanding of PIC MCU's, and the related electronics components (caps, pots, resistors, 7805's, 555 timers, etc . . .). . . . .I guess, at the end of the day, asm just fell to the bottom of my list. Just came up with what i think is a marketable idea and am equally caught up in design issues (mostly around casting parts in composites without air bubbles and such, but that is a differnet thread)

The real issue is that I am using the counting of encoder feedback vie asm interrupts to track my stepper motors and seem to be unable to (unless i slow the motors down quite a bit) to stop at exactly the right spot where my encoder signals hit 1600 (one full rotation of the stepper motor). I track the steps and find my motor stopping at 1605 or 1606 or. . . .but not at 1600. If I slow the motor down using 1/4 1/8 or 1/16 steps I am spot on, once I get my rpm in the 200 rpm range on single step I seem to be missing steps. this is where I was thin=king that my "if encoder signals >= 1600 then " loop would be better suited for asm, maybe that would remove the lag and allow me to speed up the motor a bit without a.

i will take a look at the asm tutorial that you sent Alan, thanks for that. . . .thanks again all

Heckler
- 11th March 2013, 03:03
yeah, I under stand your need is to get a piece of code up and running in order to get your project working, while not spending a LOT of time learning a new skill you may not need again for a while.

I feel your pain.

The example Acetronics provided looks pretty decent as a tutorial.

The problem with writing a piece of code in PicBasic and then looking at the ASM file is it will be quite bloated in comparison to what one would write if they were proficient at Assembly.

In order for PBP to be able to do what it does it will have to take MANY more assembly steps than the same piece of code written is assembly to start with. That is the nature of any higher level language.

good luck

Acetronics2
- 11th March 2013, 08:19
Hi Robert (et al)

The real issue is that I am using the counting of encoder feedback vie asm interrupts to track my stepper motors and seem to be unable to (unless i slow the motors down quite a bit) to stop at exactly the right spot where my encoder signals hit 1600 (one full rotation of the stepper motor). I track the steps and find my motor stopping at 1605 or 1606 or. . . .but not at 1600. If I slow the motor down using 1/4 1/8 or 1/16 steps I am spot on, once I get my rpm in the 200 rpm range on single step I seem to be missing steps. this is where I was thin=king that my "if encoder signals >= 1600 then " loop would be better suited for asm, maybe that would remove the lag and allow me to speed up the motor a bit without a.



Hi, CCpCo

I do think a thread about this subject is running at this time on this same forum ...

may be ideas to find there ???

About assembler ... 10+ years of PBP (! ) convinced me the knowledge of assembler is really compulsory ... if you want to create projects somewhat " advanced ", of course ...
note learning the inners of pics and learning assembler ... lead to the quite the same knowledge.

AND you MUST learn pics inners ...

so, impossible to avoid assembler !!!

Alain

Acetronics2
- 11th March 2013, 08:22
Hi, Robert

Did you seriously try what you tell here ???

surely not !!! :D:D:D

Alain

Demon
- 11th March 2013, 11:54
Hi, Robert

Did you seriously try what you tell here ???

surely not !!! :D:D:D

Alain

Nope, but that's where I would start to get an idea. Then I'd see if I can trim without messing up the program.

Learned ASM back in 83-85 and haven't touched it since.

Robert