In SX Microcontrollers, SX/B Compiler and SX-Key Tool, George Herzog wrote: Thanks. I am learning a lot about how to collaborate and how to sort through different peoples approaches to writing SASM. I too thought that I should use Port B, but I checked the AS BUILT board and it uses Port A. Andrew came through with the most appropriate code. [But be careful, it is buried as a 'Conditional R/C Reciever Routine' in over 30 pages of SASM.] 30 pages of code! For one chip. The actual useful information comes out at one and one-half pages. So I am moving ahead. I suspect that if my ISR is fast enough, I can afford to miss the edge detection. Of course it means that I don't have the interupt either. Do I really need another interupt? I suspect not this one as it might upset the timing. Andrew seems to think 127 pulses is adequate, so I have a lot of room for moving the timing around in code. One of the problems with using the edge detecting is that I have to 'waste' a couple of steps of code to switch direction. So why bother? And it does limit me to Port B. There are lots of ways to do this that are wasteful and I certainly have thought of my share. Andrew simply has a Register assigned to each Input Pin and it is incremented when that Pin is High. Each pin is polled at a rate that is roughly 2ms/127. Since there is a 2ms pulse with roughly a 18ms no pulse [could be much shorter] on one channel, you just immediately process the data for all ports after the last channel shuts down. With front-to-back reception of 8 channels [8x2ms max] You still have about 4ms to do so under the worst case with 8 channels [but I am using only 4 channels]. In sum, I seem to be getting some very compact, simple code that can easily handle a full 8 channels of R/C PWM inputs. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=109161#m109699 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)