Shop OBEX P1 Docs P2 Docs Learn Events
help me understand — Parallax Forums

help me understand

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)





Comments

  • The LEDs on the evaluation board are active low.

    There's a buffer between the P2 and the LEDs.
  • Well thats an easy enough answer. Thanks quick answer.
    Why would active low LEDs be desirable?
  • groebke1 wrote: »
    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.

  • Cluso99Cluso99 Posts: 18,069
    Active low goes back in history when there was more drive current available by pulling a line low than driving it high.

    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.
  • cgraceycgracey Posts: 14,155
    I think in our case, we just spec'd an inverting 8-bit buffer. Maybe VonSarvas chose an inverting buffer because many of those top eight signals are active-low, like RX, TX, and SPI_CS. It's better for the lights to come on when something is happening, rather than during idle states.
  • Those two leds on P56 / P57 on the Edge module, are those active low, or active high?
  • cgraceycgracey Posts: 14,155
    Tubular wrote: »
    Those two leds on P56 / P57 on the Edge module, are those active low, or active high?

    They are active-high.
Sign In or Register to comment.