DPRG
DPRG List  



DPRG: Getting LEDs to light up on port D of BB2

Subject: DPRG: Getting LEDs to light up on port D of BB2
From: Erick Wagner wagnere at netcom.com
Date: Fri Jun 4 11:02:31 CDT 1999

If you want to light all of the LEDs, you'll need to place
one's in each bit position not just four.

You coded a binary literal of %111100 which amounts to
six bits, not eight. The since register A is 8-bits wide,
the assembler padded on the left with leading zeros. So
you actually sent %00111100 ($3C in hex) to port D. Assuming
your circuitry is correct, you'd only light up 4 LEDs at
most.

How is your circuitry designed? Are the LEDs supposed to light
up when the bit is one (current sourcing) or when the bit is
zero (current sinking)?

Try sending %11111111 or $FF to Port D to see if that works
any better.

It's been a while since I've done any 68hc11 stuff and my
books are at home so I can't fully critique your code.

What part of OKC do you live in?  Occasionally I drive up
that way to visit my parents. They are in the NW part of 
town (near 122nd and Rockwell).
- -- 
Erick Wagner
wagnere at netcom.com

------------------------------

More information about the DPRG mailing list