In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote: You can declare bits but I think it's a wise idea to declare their byte container first, then alias them -- this gives you better control and memory management in my opinion. I use a couple bit flags in the attached demo, but both are aliased into a byte so I have maximum control. While it is very easy to get wrapped around the axle in academic discussions about what is or isn't theoretically possible, you'll get to your goals more quickly by writing real code. Yes, along the way you'll run into road blocks an pitfalls, but you'll learn a lot in the process. As my friend PJ Monty says, learning syntax is easy, learning to program takes effort. Since I mentioned serial and suggested a clock array I've attached a demo that actually uses them. This framework takes care of buffered transmit and receive as well as maintaining an RTC -- all in the "background." Note that the RTC values are stored as BCD; very much like the DS1302 and similar chips. If you have a PDB you can use the extra serial interface to connect to your PC running HyperTerminal (or something similar). As you can see, the foreground code is able to access the clock variables as if they were in the normal RAM space when it wants to send them to the terminal using the TX_HEX2 subroutine. A lot of this code is highly modular and I use it over and over. As your expertise in SX/B develops you'll find yourself doing the same thing. Sure, you make a few tweaks here and there for changing clock or ISR rate, but that's a small price to pay. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=290725#m290829 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)