help me understand
groebke1
Posts: 5
in Propeller 2
I have a rev b eval board.
When I run the simple program below the terminal values are correctly adding 1 with each iteration.
When I look at the leds, the values are inverted from what I would expect. I would think writing a "1" to the out register should turn on the LED.
Can someone explain to me why the LED values are inverted?
Thanks in advance
Greg
_clkfreq = 10_000_000
pub go() | LEDs
repeat
LEDs += 1
debug(ubin(LEDs), "'")
pinwrite(56 addpins 7, LEDs)
waitms(2000)
When I run the simple program below the terminal values are correctly adding 1 with each iteration.
When I look at the leds, the values are inverted from what I would expect. I would think writing a "1" to the out register should turn on the LED.
Can someone explain to me why the LED values are inverted?
Thanks in advance
Greg
_clkfreq = 10_000_000
pub go() | LEDs
repeat
LEDs += 1
debug(ubin(LEDs), "'")
pinwrite(56 addpins 7, LEDs)
waitms(2000)
Comments
There's a buffer between the P2 and the LEDs.
Why would active low LEDs be desirable?
I'm not sure but my guess would be they wanted an inexpensive buffer chip which wouldn't interfere with the I/O pins if the pins were used for other purposes.
FWIW, active low LEDs are pretty common.
And now, often LEDs have a voltage drop around 3V which means they need to be tied to 5V so that the resistor can be calculated to set the current reliably.
They are active-high.