Shop OBEX P1 Docs P2 Docs Learn Events
Hardware design question on how to reduce pin count on SX52 into a SX48. — Parallax Forums

Hardware design question on how to reduce pin count on SX52 into a SX48.

T&E EngineerT&E Engineer Posts: 1,396
edited 2008-08-10 23:37 in General Discussion
In reference to a past completed project: http://forums.parallax.com/showthread.php?p=649643

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:

Currently for an SX52 proto board, here are the all of the pins used for my project (using pushbuttons to set the time/date):
'
' IO Pins
'


Anodes· ·· PIN·· RDE· OUTPUT
Cathodes··PIN·· RBC· OUTPUT


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


Red·········VAR·RA.3··· ' Connect /OE of (1 & 3) 74HC573
Green······VAR·RA.4··· ' Connect /OE of (2 & 4) 74HC573


Clock······VAR·RA.5··· ' shift clock (74HC165.2)
SerData·· VAR·RA.6··· ' serial data (74HC165.7)
Load1······VAR RA.7··· ' input load (74HC165.1)




However, I have another earlier version where the user can set the time in the SXB program and not use the pushbuttons and just compile it every time. But I still am 1 pin over for RA.

Perhaps I can use some logic to combine RA.3 (green LED control) and RA.4 (red LED control) into 1 SX52 pin (RA.3) then this would work for an SX48 (RA0-3). Any ideas?

'
' IO Pins
'

Anodes· ·· PIN·· RDE· OUTPUT
Cathodes··PIN·· RBC· OUTPUT


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


Green········ VAR·RA.3··· ' Connect /OE of (1 & 3) 74HC573
Red··········· VAR·RA.4··· ' Connect /OE of (2 & 4) 74HC573

:
:

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

' 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).

I asked another individual about how to approach this and here was his comments:

The first thing that comes to mind is a couple of flip flops
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.·


Don't forget that shift registers can be cascaded to get even more IOs
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.

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

Comments

  • mojorizingmojorizing Posts: 249
    edited 2008-08-10 18:11
    For the LED's , you can use a by-colored LED connected to one pin in series with a CD4049 invert buffer. HIGH is one color, LOW is the other color and tristate (change mode of pin to input) is off. Here's a screen shot of an example - pin trace is coming down from the top, at the bottom is a LED pack.

    Noname.jpg

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Bad spellers of the world untie!

    Post Edited (mojorizing) : 8/10/2008 6:27:01 PM GMT
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2008-08-10 20:13
    That's an interesting approach. Let's see if I got this right.

    A HIGH on the pin would make Red a HIGH (off) and Green a LOW (on).

    A LOW on the pin would make Red a Low (on) and Green a High (off).

    A·INPUT on the pin would make Red a Low (on) and Green a LOW (on).

    This sounds like it would work - but I'm questioning if I would still need a pulldown resistor on the Red line and another pulldown resistor on the output of the invertor.

    I don't have any CD4049's but I have attached a list of parts I do have (some of them being):

    74HC14 - HEX INVERTING SCHIMITT TRIGGER

    74LS04 - HEX INVERTER

    74LS05 - HEX INVERTER - LOW SCHOTTKY

    74LS14 - HEX SCHIMITT TRIGGER INVERTERS

    CD4050BE - HEX NONINVERTING BUFFER

    MC14069UBCP - HEX INVERTER

    Perhaps if any of these won't work, something can be made up of what I do have (attached).

    Thanks,

    Tim
  • mojorizingmojorizing Posts: 249
    edited 2008-08-10 22:08
    You don't need a pulldown resistor in this circuit, because the invert buffer supplies the power/ provides the sink when ever the SX provides the sink/ supplies the power. I'm not sure of the bi-color LED I used - this came from a project from many years ago.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Bad spellers of the world untie!
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2008-08-10 23:37
    Great. I will try that out this week.

    Remember that the 2 lines are going to /OE control lines on 2 pair of 74HC573 ICs. The /OE just allow the red or green pairs of LEDs to pass through or not (turn on or not that is). So the /OE lines will just need to be LOW to turn either the red LED pair of 74HC573 ICs on or the other green LED pair of 74HC573 (2 are needed for both red and green LED pass through as a single 74HC573 only has 8 outputs (so we need a pair for 16 red or 16 green LED outputs of control) as this is a 16 x 16 LED display).

    Can I just use any inverter (e.g. 74HC04) or does it have to be the CD4049 (which I don't have - perhaps a 74LS04 with a CD4050 buffer would work)?

    Thanks again!
Sign In or Register to comment.