In SX Microcontrollers, SX/B Compiler and SX-Key Tool, PJMonty wrote: Peter, I agree. Time spent learning how to handle interrupts and communication between FG and BG code is time well spent. Perhaps the single strongest feature of the SX chips is the jitter free interrupt. I can treat the SX like a piece of dedicated hardware because the lack of jitter in the interrupt system allows me to have 100% deterministic response time. In addition, by dividing tasks between FG and BG, I [i]guarantee[/i] time critical code is executed. In one of my projects, I have an SX that communicates with a 68HC11. The SX polls the communications lines in the interrupt handler. Mind you, it doesn't block. It just checks the status and acts when the line has done what it is waiting for. By counting the duration of the code path in the 68HC11, I am able to set an RTCC interrupt rate in the SX that [i]absolutely guarantees[/i] it will never miss a communication request by the 68HC11. There is no wondering if it's fast enough. I can prove that I am sampling the communication line at around 3X faster than the 68HC11 can toggle it. This allows my FG code to do whatever it needs with the data as it comes in because the interrupt will always catch the data and notify the FG when it is ready. This has also given me a huge advantage in writing multi-threaded code for Windows. The lessons learned on how to synchronize communication between the FG and BG is just like synchronizing communication between threads in Windows. As a result, my multi-threaded Windows apps cruise along without running afoul of issues like race conditions because I learned how to deal with those (the hard way) writing assembly language code (using interrupts) on various micro platforms. [list]Thanks, PeterM[/list] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=147881#m147986 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)