In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Peter Van der Zee wrote: Hi Bebop; A couplke of point to help get you going..... 1. Once you set the mode to $0F (TRIS), it will stay that way until you change it, so there is no need to repeat the mode statement it to configure the second and third port. 2. To de-glitch the initial state, you ought to set the output registers to their intended values befor you make the ports an output. If you don't, then you may get a glitch for the duration between making a port an output, and then setting its value. If you first set the value, and then enable them as outputs, they will come up in their intended state. 3. The same holds for RTCC. You should set its value before you enable it. The reason is there is a (small) chance that on power up the RTCC had an arbitrary large value, say 254 or 255, then as soon as you enable the RTCC, it will quickly overflow and jump into the interrupt routine at 0 right away, before it has had a chance to complete the initialization. Cheers, Peter (pjv) ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=107862#m108645 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)