Alegro 6276 LED driver?


Closed Thread
Results 1 to 3 of 3
  1. #1

    Default Alegro 6276 LED driver?

    hi, can anyone help get me started with the A276? I'm using it to drive a 10 bar LED array.

    I have the A6276 set up like this:

    PIN:
    1 (GND): Ground
    2 (SDI): Serial Data input, PIC16F876 PORTC.0
    3 (CLK): Serial clock input, PORTC.1
    4 (LE) - Latch Enable, PORTC.2
    5- 20 : connected to GND pins of LED bar
    21 (OE) - Output Enable, PORTC.3
    22 NA
    23 (Rext) - 220 ohm to GND
    +5 (Vdd): Logic Supply. 5v

    Here's my current code:

    controlBar:
    'select the driver for Bar LED
    HIGH outenable_6276
    'set data
    bits_6276 = 1023
    LOW clock_6276
    LOW latch_6276
    'shift data out
    SHIFTOUT data_6276, clock_6276, MSBFIRST, [bits_6276\10]
    HIGH latch_6276
    PAUSE 100
    LOW outenable_6276
    return

    many thanks,
    Tobie

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi Tobie,
    5- 20 : connected to GND pins of LED bar
    I assume that means the cathodes of a common anode LED bar?
    If so OK.

    23 (Rext) - 220 ohm to GND
    Seems kind of low. That would give 80 ma constant current per LED.
    Around 1K would be better. (20 ma)

    The code looks like it should work. Assuming the parts you didn't include are OK.

    What problem are you having?
    Won't compile?
    No display?
    DIM, Too bright?
    <br>
    DT

  3. #3


    Did you find this post helpful? Yes | No

    Default Alegro 6276 LED driver?

    hi Darrel,

    thanks for your message, i have things working now, also with some help from Michael DelGaudio who sent some arduino code.

    I had MANY problems with my approach, icluding the 2 things you mentioned!

    1st was, as you mentioned, the 6276 acts as a sink, meaning it takes the cathode, or ground pins of the LED array (in my case an LedTech LL10000, a 10 bar display). I'm also using some kingbright LEDs and these have a common cathode, so I learnt that I need to get the common anode version if I want to drive them with the 6276.

    Also from your point I realised a 220 ohm resistor on the 6276 meant each LED drew too much current. This maxed out my power supply, and amongst other things caused the PIC to reset - this was a horrible mess.

    Anyway, things are working now, many thanks.

    code below for PIC16F876 driving 2 x 6276

    bests,
    Tobie


    'Testing 2 Allegro 6276 drivers, each driving a 10 bar LED array
    'Tobie Kerridge for HHH, with thanks to from Michael DelGaudio for initial code

    DEFINE LOADER_USED 1 'enable bootloader
    DEFINE osc 20 'XTAL frequency

    'pin definitions
    data_6276 VAR PORTC.0 ' Data to 6276 driver from PIC
    clock_6276 VAR PORTC.1 ' Clock for 6276 driver
    latch_6276 VAR PORTC.2 ' Latch enable for 6276
    enable1_6276 VAR PORTC.3 ' Chip select 6276 driver for LED bar 1
    enable2_6276 VAR PORTC.4 ' Chip select 6276 driver for LED bar 2
    LEDdebug VAR PORTC.5

    'varibles
    bits_6276 VAR WORD
    loopInt VAR BYTE

    '---------------------INIT-------------------

    init:
    'disable LED drivers
    HIGH enable1_6276
    HIGH enable2_6276
    HIGH LEDdebug
    Pause 1000
    LOW LEDdebug
    goto debugLoop

    '---------------------LOOP-------------------

    debugLoop:
    GOSUB controlBar
    PAUSE 1000
    GOTO debugLoop

    controlBar:
    'enable both drivers
    LOW enable1_6276 'select the driver for Bar LED
    LOW enable2_6276 'select the driver for Bar LED

    'drive 1 through to 10 bars
    for loopInt = 0 to 9
    'takes a value from a table to create LED bar pattern
    LOOKUP2 loopInt, [1,3,7,15,31,63,127,255,511,1023], bits_6276
    LOW clock_6276
    LOW latch_6276
    'shift data out
    SHIFTOUT data_6276, clock_6276, MSBFIRST, [bits_6276\10]
    HIGH latch_6276
    PAUSE 100
    next loopInt

    ' disable all bars then disable drivers
    bits_6276 = 0
    SHIFTOUT data_6276, clock_6276, MSBFIRST, [bits_6276\10]
    HIGH enable1_6276
    HIGH enable2_6276
    return

Similar Threads

  1. Conway's Game Of Life
    By wellyboot in forum mel PIC BASIC Pro
    Replies: 45
    Last Post: - 28th May 2020, 06:14
  2. Free Project - 245 LED Display
    By T.Jackson in forum Code Examples
    Replies: 221
    Last Post: - 16th August 2009, 04:59
  3. new and need help
    By smeghead in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd November 2008, 20:19
  4. Replies: 0
    Last Post: - 4th September 2007, 18:26
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts