Shop OBEX P1 Docs P2 Docs Learn Events
Strange Behavior on RPM Board — Parallax Forums

Strange Behavior on RPM Board

Tony B.Tony B. Posts: 356
edited 2010-08-17 17:23 in Propeller 1
I have the RPM Board from Parallax. The other day while doing some work on it I noticed some strange behavior and I am puzzled as to the cause. If I type the following Spin code in(this is all the code) the LEDs in the LED bar light. They should not light all I have done is set the direction register for pins 25..16

PUB Main

dira[25..16]~~

Repeat

But if I type in this code and run it they all go out. This is when I would expect them to be on.

PUB Main
dira[25..16]~~
outa[25..16] := %1111111111
repeat

Only thoughts or suggestions would be most helpful as to the cause of this. Just to make sure, I tried the code on my PPDB and it work as expected.

Tony

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2010-08-17 06:37
    Tony B. wrote: »
    If I type the following Spin code in(this is all the code) the LEDs in the LED bar light. They should not light all I have done is set the direction register for pins 25..16

    From looking at the schematic, the LEDs are connected through R to Vcc (DemoBoard is using GND). Which means that when the prop pin is low they light up. Setting dira[N] as an output pulls the relevant pin low as outa[N] defaults to 0. Therefore the LEDs light up in your first example.
  • Tony B.Tony B. Posts: 356
    edited 2010-08-17 07:08
    Thanks, I missed that in the schematic, because I thought that a pin(s) set to ouputs didn't connect to GND, but to VCC only. I thought that a connection to GND only happened when set as inputs.

    It seems to me that it would have been better to tie the LEDs to GND than VCC

    Thanks,
    Tony
  • localrogerlocalroger Posts: 3,452
    edited 2010-08-17 10:41
    Pins configured as outputs short to ground when off and they short to Vcc when on. You could hook up the other end of the LED's to either Vcc or GND and make them work. Connection to Vcc is often used because it is cheaper to build open collector power drivers (which short to ground but not to Vcc) than push-pull drivers like the Prop has; many traditional TTL IC's with power outputs are this way, so people get in the habit of wiring power devices between the output pin and Vcc.
  • Tony B.Tony B. Posts: 356
    edited 2010-08-17 17:23
    Localroger,

    Thanks for the helpful information I wasn't aware of that. I appreciate you taking the time to respond.

    Tony
Sign In or Register to comment.