In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Sparks-R-Fun wrote: [QUOTE="Marky-Mark"]Sparks-R-Fun, can you give me an exaple of how and why I will need to learn about the architecture? Would I have to learn right of the bat, or could I learn as needed? If the learning is a quest to itself, that might be too much, else it will be worth it.[/QUOTE] You will not need to know much about the SX architecture early on. Perhaps you never will. Yet I have found it quite helpful for more 'advanced' projects. By advanced I mean things that rely upon features of the chip itself as opposed to generic software concepts that might be valid on many different platforms. For example, I designed a three-phase motor controller that relied upon a shaft encoder to determine the rotor position and apply the appropriate control signals. I used some of the Port B pins to interrupt the processor whenever new position information was detected. I could have run a continuous software loop to poll for this information but that would have wasted a lot of processor time and might have resulted in a slower response. However, understanding that Port B pins can be configured to interrupt the processor and cause it to run a separate subroutine allowed me to structure my program in a different manner. I think it allowed for a better solution. I have also found it helpful on two occasions to map out where each of my program variables resides in memory. I did this because some of my programs have grown to be quite complex. I never did this starting out. It was not necessary. SX/B takes care of placing variables in free memory space much like the Basic Stamp environment does. Most likely you will never care to know where each one goes. However, I had an instance where I did care and with the SX it is possible to know and even change this! As another example, at one time I was trying to figure out how to do something tricky with the built-in timer/counters on the SX48. At about that same time Bean (a frequent poster here and a great help) figured out a clever way to read in the value I was trying to obtain by switching the timer/counter between modes. In a sense he 'tricked' it into doing what he (and I) wanted. He was able to accomplish this by understanding the architecture of the SX chip. He used that knowledge to figure out a clever way to accomplish what he was trying to achieve. So it helps sometimes to understand how the chip is structured and how the various parts work and interconnect. Initially you might treat all pins the same as I did thinking "[I]An I/O pin is an I/O pin![/I]" Now I think things like "[I]This pin is an I/O pin that can also interrupt the processor.[/I]" "[I]This pin in an I/O pin that can also indicate the comparative voltage levels of two other pins.[/I]" Or "[I]This pin is an I/O pin that can be set up to output a specified duty cycle completely on its own without requiring constant attention from the processor.[/I]" You do not need to understand the SX architecture to start using the SX. But learning about its architecture is helpful in ways that have no real comparison in the Basic Stamps, at least as far as I understand them. - Sparks ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=211362#m213445 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)