In SX Microcontrollers, SX/B Compiler and SX-Key Tool, VelocitąPaola wrote: Hi all, You'll have to bare with me, as I'm new to both programming and the SX chip. I'm currently running into a few problems while trying to compile my code, and I'd sure appreciate it if someone with more experience could give me a hand. So, here's the gist of what's going on. I'm trying to write a program that translates the duty cycle of an incoming PWM signal into movement of a bipolar stepper motor. This stepper motor has a range of 0 to X steps, and basically, a 0%DC means the stepper is at position 0, while 100%DC means the stepper is at position X. The relationship is linear, so the rest is easy for the chip to figure out. Now, the whole thing is coded in SX/B, and I've managed to get rid of all SX/B syntax errors. The only errors I'm encountering are while trying to compile in the converted assembly. It's giving me error codes for "Address not within lower half of memory page" for several of the subroutine labels. I did a little research, but due to my unfamiliarity with the SX assembly language, I couldn't even begin to figure out why it's giving me these errors. Also, I'm trying to use an absolute value operator, but I don't really know how to implement this. I thought "ABS" could be used in PBASIC, so I assumed it could also be used in SX/B, but the SX-Key software is giving me problems when I try to convert to assembly. I'm attaching a text file of the SX/B code, and assembly code for anyone who can help to look through. I'm also attaching an "algorithm" of pseudo-code that I wrote to help me make the actual code. It may help you understand what I was aiming for in case my programming is a little convoluted. Again, I really appreciate any insight you can share with me. I'm new to programming, but I'm really very eager to learn, so your advice will not be wasted. Thanks again! ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=155208 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)