Strange Behavior on RPM Board
Tony B.
Posts: 356
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
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
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.
It seems to me that it would have been better to tie the LEDs to GND than VCC
Thanks,
Tony
Thanks for the helpful information I wasn't aware of that. I appreciate you taking the time to respond.
Tony