In SX Microcontrollers, SX/B Compiler and SX-Key Tool, tdg8934 wrote: In reference to a past completed project: [url=http://forums.parallax.com/forums/default.aspx?f=21&m=189908]http://forums.parallax.com/forums/default.aspx?f=21&m=189908[/url] I want to find a way to reduce the project so that it can be used on an SX48 from it's current use on an SX52 (proto board). I have attached 2 files (v3B - SX52 only as it used extra hardware to control the clock with pushbuttons) (earlier v3 - SX52 or possibly with extra hardware designed in to work on an SX48 proto board - no pushbutton control, all in compiling the SXB). Hopefully you can follow what I am saying ... but read on for more clarity: [color=#0000ff]' ------------------------------------------------------------------------- ' IO Pins ' ------------------------------------------------------------------------[/color] [color=#0000ff>Anodes ]Cathodes PIN RBC OUTPUT[/color] [color=#0000ff> Dta VAR RA.1 ' Connect DS1302.6 to this pin RTCCS VAR RA.2 ' Connect DS1302.5 to this pin[/color] [color=#0000ff> Green VAR RA.4 ' Connect /OE of (2 & 4) 74HC573[/color] [color=#0000ff> SerData VAR RA.6 ' serial data (74HC165.7) Load1 VAR RA.7 ' input load (74HC165.1)[/color] [color=#ff0000]' ------------------------------------------------------------------------- ' IO Pins ' ------------------------------------------------------------------------[/color] [color=#ff0000]Anodes PIN RDE OUTPUT Cathodes PIN RBC OUTPUT[/color] [color=#ff0000][/color] [color=#ff0000]Clk VAR RA.0 ' Connect DS1302.7 to this pin Dta VAR RA.1 ' Connect DS1302.6 to this pin RTCCS VAR RA.2 ' Connect DS1302.5 to this pin[/color] [color=#ff0000][/color] [color=#ff0000]Green VAR RA.3 ' Connect /OE of (1 & 3) 74HC573 Red VAR RA.4 ' Connect /OE of (2 & 4) 74HC573[/color] [color=#ff0000]:[/color] [color=#ff0000>: [/color] [color=#ff0000]For Color = 0 to 2 If Color = 0 THEN HIGH Green LOW Red ELSEIF Color = 1 THEN Low Green HIGH Red ELSEIF Color = 2 THEN Low Green Low Red Endif[/color] [color=#000000]' A FOR-NEXT cycle is used to go through all colors and either turn on (active LOW) red LEDs, green LEDs or red+green LEDs (orange/yellow).[/color] [color=blue>The]configured as a shift register. You will then need an extra line of code to transition past the high-high state. Since that is off/off for the LEDs and will only last an instruction or two I can't imagine that there will be any visual glitches. You also need to make sure that it comes up in a reliable state. If the chip doesn't guarantee that you can probably tie the flip-flop resets to a power reset pin on the SX48. [/color] [color=blue> Don't]from a few MCU pins and that they have latches to avoid glitches during the load periods. If you have more buttons than the two time setting buttons you can save pins with either a shift register or a matrix arrangement.[/color] Does this sound possible with an SX48 or is there any simpler method to use 1 SX I/O pin and control 2 additional lines to external hardware (requires either high or low on those 2 additional control lines)? Thanks, Tim ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=284498 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)