One or the other works but not both
lardom
Posts: 1,659
· I am programming a·linear slider that uses a stepper. If I program it to travel six inches I want it to start by first backing up three inches at a set speed. Thirdly I want it to return to its home position.
· I can program it to travel six inches··"or" ·I can get it to back up three inches by commenting out line 112 or line 114 but if line 112 is executed then·line 114 causes the motor to chatter. I typically put in 500 for 'distance' and 235 for 'speed'. In the stepper object "LarrysStepper4App" I had to comment out line 35. I clearly don't know what's getting mangled.
--- I had to copy the top object to MS Word. I hope it compiles correctly.---
·
·
· I can program it to travel six inches··"or" ·I can get it to back up three inches by commenting out line 112 or line 114 but if line 112 is executed then·line 114 causes the motor to chatter. I typically put in 500 for 'distance' and 235 for 'speed'. In the stepper object "LarrysStepper4App" I had to comment out line 35. I clearly don't know what's getting mangled.
--- I had to copy the top object to MS Word. I hope it compiles correctly.---
·
·
doc
39K
Comments
Where is the LS.mark function? To post your code properly and fully use the archive function under FILE, ARCHIVE, PROJECT in the Propeller Tool.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
It's very simple as to what is happening as you are starting up the second cog in line 114 when a cog is still executing in line 112. Rather than using cognew methodsto initiate each type of function it would be far better that you just create a stepper function in a cog to which you pass commands to make it half and full step etc.
Scrub that, I may have misread it but you are controlling the DIR register from the main cog and also the DIR register (independent) in the new cog. Remember that the DIRA and OUTA registers are not global, each cog has it's own.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
Post Edited (Peter Jakacki) : 3/1/2010 2:09:41 AM GMT
·This forum is absolutely essential.·I wish I had discovered mcu's years ago. (I can imagine a robot that answers when I call and obeys a few simple commands.) Thanks again for solving my current problem.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
· Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz