November 23, 2024, 07:20:40 AM

News:

Be sure to checkout our Vixen interfaces in the Library forum -- if you want PC automation at near zero cost, EFX-TEK and Vixen is a great combination of tools.


pin6 & pin7 stay on or stay off....

Started by brittio, August 04, 2009, 04:49:35 PM

Previous topic - Next topic

brittio

I'm in the process of making LEDs chase and I'm using all 8 outputs on my Prop1.  Pin6 and Pin7 either stay off or stay on depending on where my jumpers are. 

How do I get them to act like the other 6 pins?

JonnyMac

Move them to the DN position which forces the processor to activate the ULN outputs.
Jon McPhalen
EFX-TEK Hollywood Office

brittio

I apologize...  I only mess with my Prop1s around Halloween so there always seems to be a learning curve. 

I tried moving the jumpers again and got the same results.  with the jumpers DN my LEDs stay turned off.  with the jumpers UP my LEDs stay turned on.  I also tried removing the jumpers all together, but the LEDs still stay turned off.  All of my other LEDs (pin0 thru pin5) are acting as expected.  Is that a sign that somethings bad or is there something else on the board that could affect this?

JonnyMac

With the jumpers in the DN position the P6 and P7 will behave like the others that are pulled DowN by the ULN inputs.  Can you show me your code?
Jon McPhalen
EFX-TEK Hollywood Office

brittio


' {$STAMP BS1}
' {$PBASIC 1.0}

'-------------constants-------------
SYMBOL  on               = 1

SYMBOL  off              = 0

'-------------i/o def------------
SYMBOL  num1            = PIN0          ' leds

SYMBOL  num2            = PIN1

SYMBOL  num3            = PIN2

SYMBOL  num4            = PIN3

SYMBOL  num5            = PIN4

SYMBOL  num6            = PIN5

SYMBOL  num7            = PIN6

SYMBOL  num8            = PIN7

SYMBOL  pntr            = B5            ' pointer

setup:
  pntr = 0

'-------------initialize prop------------
Reset:
  DIRS = %00111111
  DEBUG CLS, "reset"
  pntr = 0
  num1 = on
  num2 = on
  num3 = on
  num4 = on
  num5 = on
  num6 = on
  num7 = on
  num8 = on

'-------------PROGRAM----------------
Main:

FOR pntr = 0 TO 5
  PAUSE 400
  num8 = off
  num1 = on
  PAUSE 400
  num1 = off
  num2 = on
  PAUSE 400
  num2 = off
  num3 = on
  PAUSE 400
  num3 = off
  num4 = on
  PAUSE 400
  num4 = off
  num5 = on
  PAUSE 400
  num5 = off
  num6 = on
  PAUSE 400
  num6 = off
  num7 = on
  PAUSE 400
  num7 = off
  num8 = on
  PAUSE 400
  num8 = off
NEXT
GOTO reset


JonnyMac

August 05, 2009, 12:29:27 PM #5 Last Edit: August 05, 2009, 12:31:17 PM by JonnyMac
Problem solved: If you're going to use that code structure you need to make all pins outputs.  Change this:

  DIRS = %00111111

to:

  DIRS = %11111111

There version in your program is telling P6 and P7 to be inputs which means that the output drivers in the chip are disconnected.


Just a hint: ON is a keyword in PBASIC2 (used in the Prop-2) so you should avoid it -- if you decide to move your program to a Prop-2 this will create a error.  In my programs I use the constants IsOn (1) and IsOff (0).  Code then reads more like English:

  Light = IsOn

Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

BTW... you can simplify your reset section to this:

Reset:
  PINS = %11111111                              ' all on
  DIRS = %11111111                              ' all outputs

  DEBUG CLS, "Reset"


The PINS register lets you write to all outputs at once and you don't need to reset pntr because the FOR-NEXT loop handles that.
Jon McPhalen
EFX-TEK Hollywood Office

brittio

AWESOME....  I knew it was something easy.  Thank you for your help.